2
GitHub - mkopa/nestjs-boilerplate: NestJS Boilerplate template with proper proje...
source link: https://github.com/mkopa/nestjs-boilerplate
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Description
NestJS Boilerplate app with Node 18+, docker-compose, Postgres, TypeORM, Joi and GitHub Actions
Endpoints:
GET - get all todos
localhost:3000/tasks
POST - create new todo
localhost:3000/tasks
BODY json payload example:
{
"content": "some todo"
}
PATCH - set the existing "todo" as done
localhost:3000/tasks/:id
BODY json payload example:
{
"done": true
}
DELETE - remove todo
localhost:3000/tasks/:id
Installation
$ cp .env.dist .env
$ cp docker-compose.override.dist docker-compose.override
$ npm install
Used docker-compose version: 1.29.2, Nodejs: 18.17.1
Running the back-end
# start db
$ docker-compose up -d postgres
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# create a docker backend-service image and run the app
$ docker-compose up
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
License
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK