How do I prevent Node.js / Express serving up my application's source code? How do I prevent Node.js / Express serving up my application's source code? express express

How do I prevent Node.js / Express serving up my application's source code?


From what you posted it really smells like the URL you entered is served by e.g. Apache/nginx/... and you did put your node app within the document root. The answer is simple in this (and any similar) case:

You never put any of your sourcecode files within the document root or another HTTP-accessible folder. In your case, /home/prod/server/app/public should contain only client-side stuff (HTML, CSS, Graphics, (minified) client-side JS) and nginx should not have anything above this folder as its document root.