Skip to content

Latest commit

 

History

History
143 lines (102 loc) · 5.09 KB

README.md

File metadata and controls

143 lines (102 loc) · 5.09 KB

Nest Logo

A progressive Node.js framework for building efficient and scalable server-side applications, heavily inspired by Angular.

NPM Version Package License NPM Downloads Travis Linux Coverage Discord Backers on Open Collective Sponsors on Open Collective

Description

NestJS Framework server project generated from official JHipster NodeJS blueprint.

Installation

$ npm install

TypeORM configuration

Define your prod database

For prod database configuration, in src/orm.config.ts change your url connection:

if(process.env.NODE_ENV==='prod'){
  ormconfig = {
      ...
      url: 'YOUR CONNECTION URL',
      logging: false,
      synchronize: commonConf.SYNCRONIZE,
      entities: commonConf.ENTITIES,
      migrations: commonConf.MIGRATIONS,
      cli: commonConf.CLI,
      migrationsRun: commonConf.MIGRATIONS_RUN,
  };
}

Migration data and schema

According typeORM migration guide, there are under src/migrations/ the scripts to create the database schema and after to insert data seed. The scripts are automatically run in the first start up, and after anymore.

Running the app

# development
$ npm run start

# watch mode
$ npm run start:dev

# build and run in production mode
$ set NODE_ENV=prod&& npm run build && npm run start:prod

# run production build with node
$ set NODE_ENV=prod&& node dist/main.js

# build production bundle with webpack
$ npm run webpack:prod

# run production bundle with node (not require node_modules folder)
$ node dist/bundle.js

You can specify dev or prod NODE_ENV value (default is dev as indicated in .env) The webpack build bundle automatically is configured for prod env, and can run without node_modules

Lint

# run lint
$ npm run lint

# fix lint issues
$ npm run lint:fix

Debug

# run this and after you can execute debug task in VSCode
$ npm run start:debug

Test

# unit tests
$ npm run test

# lint
$ npm run lint

# fix lint issues
$ npm run lint:fix

# test coverage of unit tests
$ npm run test:cov

# e2e tests with full app coverage report
$ npm run test:e2e

Support

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.

Stay in touch

License

Nest is MIT licensed.