Hi THREE community,
It has been couple of days I’m trying to load a simple GLTF model using an nodejs react app but without success.
The error is I can’t get the file (404 error). I tried several approaches including the following:
in my server.js I used the following code to serve my static files:
app.use(’/api/v1/assets’, express.static(“public”))
in my scene.js I have included the following “standard” gltf loader code
var loader2 = new GLTFLoader();
loader2.load('/assets/3dObjects/glb_testing.glb', function (gltf) {
const blender_scene = gltf.scene;
scene.add(blender_scene);
gltf.scene.traverse(function (child) {
objects.push(child);
//console.log(child);
});
});
the hierarchy of my folders are:
here is the result
What am I missing
I know there are work-arounds using react-three-fiber, but If I can exhaust all my options before getting there it would be good.
Thanks a lot,