DEV Community

Discussion on: ExpressJS Project Structure

Collapse
 
brianemilius profile image
Brian Emilius

Hi @orshee 👋

Why bin/www? Because you might want other ways to run your application through. The www is "just" the server layer of the application. You could exchange it for a development-specific server layer and a production-specific layer. You could have one setup use (A) set of certificates and env settings, and the other use (B) set of certificates and so on. Or you might want to run it through a process manager such as PM2 or similar. The basic idea is that this split from the rest of the application helps with scalability. Which, incidentally is in the scope of this article.

Is it out of scope with MVC? Yes. Absolutely. I should hope it is since MVC takes care of the user interface and nothing else (bar some pseudo data negotiation).

Does this work on windows? Yep. It really does. It works on Mac, Windows, Debian, CentOS, Arch, and Mint, which are the platforms I test this on. No special setup on either of those machines. It works out of the box.

Why do you think it wouldn't?

This is not a boilerplate. It's an article about the express framework and how you can set it up in a scalable production-ready manner, with the theory behind the choices explained.

I've got to give your comment two minuses 😉