Serving Dynamic .js Files on Node?
-
I am trying to set up a NodeBB server over at fly.io. After installation I am unable to access
nodebb.min.js
:GET https://site.fly.dev/assets/nodebb.min.js?v=beq285jiqim net::ERR_ABORTED 404 Refused to execute script from 'https://site.fly.dev/assets/nodebb.min.js?v=beq285jiqim' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
I can't access the JS file in my browser at all. Is there a trick to serving resources in NodeJS? I know that in Django serving static files requires some extra work, but since
nodebb.min
is a compiled file I am really not sure how to address this.Thanks
-
@BrotherGlaucon On checking that URL, it appears to be unreachable, and the DNS entry doesn't seem to exist.
-
@phenomlab - Yes, "site" is just a fictional placeholder. There is a separate problem where the app autostops gracefully on SIGINT, but instead of autostarting properly it goes to the NodeBB installation page (link). So the URL and accompanying resources won't be persistent until I figure that out. I just wanted to work out this .js problem first.
-
It looks like Express is the way to handle static resources in NodeJS. It looks like they are being set up in <index.js>. I have no idea why the javascript resource is inaccessible.