A JavaScript API for the OpenSource BIMserver
npm install bimserverapiA JavaScript API for the OpenSource BIMserver.
``html`
The ?_v=%VERSION% addition is there for efficient caching purposes. Any server system serving these files can tell the client to cache these files indefinitely.
It is also possible to load the ES6 module directly into the browser, however not all browser support this yet.
`javascript`
import { BimServerClient } from './js/bimserverclient.js';
const api = new BimServerClient("../..");
api.init((client, version) => {
console.log(version.version);
});
`javascript`
var address = "http://addressofapi";
Promise.all([
address + "/bimserverclient.js",
address + "/bimserverapipromise.js"
].map(x => import(x)))
.then(([BimServerClient, BimServerApiPromise]) => {
var api = new BimServerClient.BimServerClient("../..");
api.init((client, version) => {
document.getElementById("version").innerHTML = JSON.stringify(version.version, 0, 2);
});
});
git clone https://github.com/opensourceBIM/BIMserver-JavaScript-API.git
`
* Go to the project directory
`
cd BIMserver-JavaScript-API
`
* Install build dependencies
`
npm install
`
* Run the build script
`
npm run build
`
The compiled file is located at build/bimserverapi.js`