I've found myself writing a lot of JavaScript lately, both client- and server-side. And over the past several projects, a common pattern has emerged: I'll have to develop a single page application with a matching back-end web API. This post explains the development and deployment setup I've centered on for these situations. It's by no means complete, but has increased my productivity immensely. Enjoy!
[…]
My initial struggle was simply about how to organize the codebases for a JavaScript project requiring both front- and back-ends. For a while, there was a single codebase (typically an ExpressJS server), with an embedded directory containing the website's source code. For my web editor of choice, WebStorm, this meant having one project embedded within another—and it just felt messy.
[…]