Serving Static in Express Node.js

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’));


I’m having this issue now. Did you manage to find a solution?

Submit an answer
You can type!ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Paths are relative to the directory from where you launch your node process.


app.use('/static', express.static(__dirname + '/public'));

Same problem here. Non of the status files in public are being found. Getting errors in the console in the browser. Any ideas?