If you use Express.js as a web server, you have a “public” folder in which you put your static files, which are served right up. Outside of this folder, you have other sibling folders where you keep your code as “controllers” and “models”. You cannot navigate to one of these folders through a web browser so that they are inaccessible because your web server root directory is "public".
project_root/ - app.js - public/ <-- web root - javascripts/ - stylesheets/ - images/ - some_static_page.html - controllers/ - models/ - routes/ - views/ - node_modules/
source share