Develop faster, easier with this template. This template is suitable for a monolith node project or microservice project (containerize or not).
.
├── _deployments/
│ └── docker-compose.yml
├── _docker-compose-env/
│ ├── database.env
│ └── server.env
├── _setup/
│ ├── create-endpoint.js
│ ├── sync-orm.js
│ └── utils.js
├── _templates
├── database/
│ ├── scripts/
│ │ └── init.js
│ └── dockerfile
├── server/
│ ├── secrets
│ ├── src/
│ │ ├── classes/
│ │ │ ├── DirReader.ts
│ │ │ └── Endpoint.ts
│ │ ├── databases/
│ │ │ └── index.ts
│ │ ├── endpoints/
│ │ │ └── index.ts
│ │ ├── services/
│ │ │ ├── auth
│ │ │ └── validators
│ │ ├── utils
│ │ ├── app.config.json
│ │ ├── db.config.json
│ │ └── index.ts
│ ├── .dockerignore
│ ├── dockerfile
│ └── tsconfig.json
├── LICENSE
└── README.md
In this template, I set up a simple application with NodeJS and MongoDB. You can setup more project if you want to do that.
If you want to create a group of endpoints, you can use the script _setup/create-endpoint.js
. For example, I want to create a person with 2 endpoints are
- Method:
Post
, Endpoint:/person/:id
- Method:
Get
, Endpoint:/person/:id
You can use this command
node setup/create-endpoint.js -a service -r person -e [get]:id -e [post]:id
The result is
Then, you can run npm run dev
to see the result