Is it possible to use ImportMesh to get a glb from my pc without using a local host

Hi, my problem is that my glb files are a little too big for github so i was hoping for a solution to load with them with imporMesh from a pc instead from a server, and i wanted to know if there was any solution to do that in any simple way, maybe without using a localHost.

Hi Kyubey, welcome to the babylon forum!

Theoretically you can use the file:// protocol, but AFAIK most browsers are not happy about enabling it and it requires flags on startup to work correctly.
What you can do is use the file API to load the file and convert it to a URL (probably using URL.createObjectURL() - Web APIs | MDN) and then use this URL to load the model just like you load any other resource.

You can put your glb file to Dropbox - Using External Assets In the Playground | Babylon.js Documentation - or try to host it at some another cloud service.

its simple to just have a local host :slight_smile:

python http.server just spins up a server in whatever folder you call it in

or

node express with a few lines

If you have node installed you can do:

npx http-server and boom the directory the command runs in is available on a server.

1 Like

Use nginx to setup an http server and load it from http://localhost/