opensourceBIM / BIMserver-JavaScript-API

BIMserver JavaScript API
GNU Lesser General Public License v3.0
56 stars 35 forks source link

Trying to connect with bimserver 1.5.53 with javascript-api newest version #2

Closed gijskoning closed 6 years ago

gijskoning commented 8 years ago

Im trying to connect with my bimserver on my local computer. But is is not working. it says: scenejs.js:42 GET http://localhost:8082/js/bimserverapi_BimServerApi.js?bust=0.0.23 404 (Not Found)

function connect(server, email, password) {
        var serveraddres = "http://localhost:8082";
        requirejs.config({
            baseUrl: serveraddres + "/js", // address should be the address of your bimserver, including optional port
            urlArgs: "bust=" + "0.0.23" // the version you use here will be used for caching
        });
        requirejs(["bimserverapi_BimServerApi", "bimserverapi_BimServerApiPromise"], function(BimServerApi, BimServerApiPromise) {
            if (address.endsWith("/")) {
                address = address.substring(0, address.length - 1);
            }
            if (BimServerApi != null) {
                var bimServerApi = new BimServerApi(address, notifier);
                bimServerApi.init(function(){// This function gets called on success, you can use bimServerApi now
                    o.bimServerApi = bimServerApi;
                    o.bimServerApi.login("email", "password", false, function(){
                        $(dialog).dialog('close');
                        o.viewer = new BIMSURFER.Viewer(o.bimServerApi, 'viewport');
                        resize();
                        o.viewer.loadScene(function(){
                            var clickSelect = o.viewer.getControl("BIMSURFER.Control.ClickSelect");
                            clickSelect.activate();
                            clickSelect.events.register('select', o.nodeSelected);
                            clickSelect.events.register('unselect', o.nodeUnselected);
                        });

                        showSelectProject();
                    });
                });
            } else {
                console.log("something went wrong with bimserverapi");
            }
        }, function (err) {
            console.log("can not connect ",err);

        });
    }
rubendel commented 8 years ago

Which versions of BIMserver and other software are you using?