i have this in my server.js. It is working fine on my local server. When i try on digitalocean. no images are showing up. I am all new to this. Please help. Thank you.
//Setting Static Files Directory app.use(express.static(‘./public’));
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!
Same problem here. Non of the status files in public are being found. Getting errors in the console in the browser. Any ideas?
Paths are relative to the directory from where you launch your node process. http://expressjs.com/en/starter/static-files.html
Try
app.use('/static', express.static(__dirname + '/public'));
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.