What is the goal? Bootstrapping without headache. A simple NodeJS skeleton.
nodemon
is used for development.
Important
Works with NodeJS >= 14
- Copy
.template.env
to.env
- Adapt if needed the configuration in
.env
- Install packages with
npm ci
For autoformatting in VSCode install the prettier
extension.
// for development mode
npm run dev
// for normal startup
npm run start
src/server
should contain all the web-server logicsrc/server/routes
should define all routerssrc/server/middlewares
contains all custom middlewares like exception handling, validation, etc.
src/handlers
should contain all the logic. Handlers act as a logical middleware betweenrouter
andrepository
( that's not a part of this repo )