项目作者: Jabinzou

项目描述 :
use nestjs and typeorm create a nodejs server
高级语言: TypeScript
项目地址: git://github.com/Jabinzou/new-blog-server.git
创建时间: 2018-07-25T16:34:39Z
项目社区:https://github.com/Jabinzou/new-blog-server

开源协议:

下载


blog-server

Description

test for ts in node server

project description

  1. --module
  2. ---- *.controller.ts //作为当前模块儿的逻辑处理层,包括http请求到处理都会经过这一层
  3. ---- *.module.ts //作为当前模块儿的封装,便于进行依赖注入,供其他模块使用,并且每一个模块都是一个共享模块,包含了当前模块所有的providerscontrollers,importsexports
  4. ---- *.service.ts // 提供了当前模块的所有的方法,用于处理逻辑层相关方法的集合
  5. ---- *.*.spec.ts // 用于单元测试
  6. -- entities
  7. --- *..entity.ts // 数据库model

pm2 manage the process

you can find your project path,then you can execute pm2 start npm --name project01 -- start

typeorm logging

nodemon watch the application and set env to resolve the ‘logging’ settting

Installation

  1. $ npm install

Running the app

  1. # development
  2. $ npm run start
  3. # watch mode
  4. $ npm run start:dev
  5. # production mode
  6. npm run start:prod

Test

  1. # unit tests
  2. $ npm run test
  3. # e2e tests
  4. $ npm run test:e2e
  5. # test coverage
  6. $ npm run test:cov