Development
Running the server
# development
$ npm start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
Test
# unit tests
$ npm test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Configuration for testing:
Node interpreter: /user/local/bin/node
Jest package: FULL_PATH_TO_PROJECT_DIR/node_modules/jest
Working directory: FULL_PATH_TO_PROJECT_DIR
Jest options: --config jest-e2e.json --forceExit
Debugging
Configuration for debugging is:
Node interpreter: /user/local/bin/node
Node parameters: node_modules/@nestjs/cli/bin/nest.js start --debug --watch
Working directory: FULL_PATH_TO_PROJECT_DIR
JavaScript file: src/main.ts
see Debug.run.xml
Debugging as package in a project
Via yalc the NestJS Server can be linked into the project.
In NestJS Server run npm run watch to watch for changes and build yalc package. Project use following scripts(via package.json):
npm run link:nest-server(foryalc add @lenne.tech/nest-server && yalc link @lenne.tech/nest-server && npm install)npm run unlink:nest-server(foryalc remove @lenne.tech/nest-server && npm install)
Documentation
The API and developer documentation can automatically be generated.
# generate and serve documentation
$ npm run docs