By davidcarrico
I am using a pre-created Ubuntu droplet with MEAN installed. I believe there is a problem in how this server maps text/javascript MIME type. It seems to only return text /html. Do these droplets use Apache by default? Where do I look for Apache conf file(s)? What am I missing here?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
The issue is two-fold: 1) I misunderstood that when using MEAN, express.js is creating a web server for me. So any special handling of content-types needs to be done within express.js configuration files and main js file. 2) I was encountering the original issue because in DigitalOcean, I am running under “production” NODE_ENV path, instead of “development”. As such, my lib/node config file was looking for files in different root paths. That resulted in my index.html looking for all script files in a path that was valid for development environment, but not in production. Therefore, my app was returning “index.html” as a failover whenever an unknown path was requested, resulting in chaos.
Lesson learned, best to test multiple environments as best as possible before deploying to actual production environment.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.