This is a demo application of a Simple ToDo REST API app to showcase base web development knowledge with containerization and full-stack development with NestJs.
Accessible at http://localhost:3001/todos OpenAPI Documentation at http://localhost:3001/api
Recommended:
docker-compose up -d --build
OR Accessible (normally) at http://localhost:3000/todos
Not recommended:
First change the mysql host in the .env file from "mysql" to "localhost"
Then:
npm install
npm run migration:run
npm run start
Note that in case of not using Docker it is required that you have a MySQL database server running locally. To create the database execute the script at docker-mysql-init\init.sql
.
Also the following environment varialbes have to be available:
- MYSQL_HOST=mysql
- MYSQL_PORT=3306
- MYSQL_DB=todo
- MYSQL_USER=youruser
- MYSQL_PASSWORD=yourpassword
Note this is required only when not using docker - otherwise the container is handling it automatically.
$ npm run typeorm:migration:run
$ npm run typeorm -- -d ./db/typeorm.config.ts migration:generate ./db/migrations/<MIGRATION_NAME>
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Vesko Petrunov
Nest is MIT licensed.