Example of Tasks API created with NestJS. Utilizes:
- typescript
- express
- eslint
- prettier
- jest
Features:
- auth - jwt (passport)
- tasks CRUD
- app config (dev/prod) with schema validation (joi)
- logging
- transform interceptor - hide sensitive data
CLI:
npm i -g @nestjs/cliBootstrapped with nest new node-server-app-nestjs.
- get motd
- create motd
- update motd
- delete motd
Model:
class Motd {
message: string;
}- get all tasks
- get task
- create task
- update task progress
- delete task
- search for task
Model:
class Task {
id: string;
name: string;
description: string;
status: TaskStatus;
}npm install class-validator class-transformer.prettierrc - removed singleQuote
.eslintrc.js - added rule for unused underscore param
"@typescript-eslint/no-unused-vars": [
"error",
{
argsIgnorePattern: "^_",
varsIgnorePattern: "^_",
caughtErrorsIgnorePattern: "^_",
},
],
$ npm install# 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:covNest is MIT.