Checking around the web, there are a number of hints, but no clear solutions on MIME type configuration to serve .babylon files exported from Blender, on Node.js.
Is anyone aware of a solution to this, thoughts on security concerns, or know a way to solve?
Thanks,
.babylon files exported by Blender can be loaded into Node.js with a dynamic MIME type setting for 'Content-type' on the response object. Also, the limited set of MIME types is likely a good practice for Node.
1) ADD Mime type into an array of all supported MIME types:
2) Within Node createServer() handler:
3) Initialize a dynamic mimeType variable from given file type:
4) Populate response Content-type:
Example Node server available on github: https://github.com/anymscape/babyloninnode
After clone, with node installed, at root, type in command line: node server
Result: 3D in Node.js thanks to BabylonJS: http://babylonjs.com/