How to structure an Express.js REST API with best practices
blog.treblle.com
blog.treblle.com
Why does structure matter? Why not use a “move fast and break things” approach and put your code wherever it seems to work?
Without good structure, it will become increasingly hard to understand your code and easier to accidentally break things. This means bugs increase and deployments become slower and riskier.
If you plan to scale your API the decisions you bake in earlier should support that. Otherwise, you’ll need to spend considerable time and expense rewriting your application.