I think I’m close to having [EDIT: the model viewer library] work with a markdown code block, but I can’t load the actual file. If I set the source to a local file, the Obsidian Developer Console tells me I’m “not allowed to load local resource”.
So, I thought I create a simple Express app to host the file locally. But when I set the source to the Express app on localhost, I get a CORS policy error:
Access to XMLHttpRequest at ‘http://127.0.0.1:3000/Astronaut.glb’ from origin ‘app://obsidian.md’ has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header is present on the requested resource.
even though I set ‘Access-Control-Allow-Origin’ to * using this following code:
app.use(
cors({
origin: '*',
})
)
Making the same request using Postman returns the file correctly, so I am at a loss here.
Does anyone else know what to do?