Posted onEdited onInnest Symbols count in article: 356Reading time ≈1 mins.
nest.js - geting start
Installation
1
npm i -g @nestjs/cli
Create a new project
1
nest new project-name
Create a new module
1
nest g module module-name
Create a new controller
1
nest g controller controller-name
Create a new service
1
nest g service service-name
Create a new pipe
1
nest g pipe pipe-name
Create a new resource
1
nest g resource resource-name
Database
Nest.js is database agnostic, you can use any database you want. For example, you can use TypeORM, Sequelize, Mongoose, etc.
Install TypeORM with mysql driver
1
npm install --save @nestjs/typeorm typeorm mysql2
Troubleshooting
Error: Nest can’t resolve dependencies of the SearchHistoryService (?). Please make sure that the argument “SearchHistoryRepository” at index [0] is available in the SearchHistoryModule context.