This is a prototype for creating rest api endpoints.
Technology | Reason |
---|---|
NodeJS | Modern JS environment and engine |
NestJS | Enterprise ready Node framework (Spring like) |
Fastify | Faster than Express for REST endpoints |
MongoDB | Fast document DB |
Yarn 2 | Modern build tool |
- Modular architecture
- REST API endpoints
- DTO validation
- MongoDB schemas with DTO transformation
- Swagger doc for REST API endpoints
yarn install
yarn run build
Run the application either within Docker engine with docker-compose or simply as a local process assuming you already have a mongodb running.
Start:
docker-compose up --build
Stop:
docker-compose down
Ensure you have a running mongodb. Default connection URL points to mongodb://localhost:27017/nested
You can override it by setting the env variable MONGO_URL.
Start:
yarn start:dev
Stop:
CMD+C
/ CTRL+C
Env variable | Default value |
---|---|
MONGO_URL | mongodb://localhost:27017/nested |
PORT | 3000 |
AUTH_SECRET | s3cr3t |
These variables can be overwritten either locally or in docker-compose.yml.