This respository stores all the code exercises for Udemy Course NestJS the Complete Developer's Guide
Covers all NestJS Lectures, except that I did not deploy to Heroku.
Some notes
npm install -g @nestjs/cli
Core dependencies:
npm install @nestjs/common@7.6.17 @nestjs/core@7.6.17 @nestjs/platform-express@7.6.17 reflect-metadata@0.1.13 typescript@4.3.2
Additional Validation Libraries:
npm install class-validator class-transformer
Type ORM and Sqlite:
npm install @nestjs/typeorm typeorm sqlite3
Cookie Sessions:
npm install cookie-session @types/cookie-session
NestJS Config
npm install @nestjs/config
Cross Env
npm install cross-env
# navigate to project dir
cd ./01-scratch
# run
npx ts-node-dev src/main.ts
PostGres Driver for Production
npm install pg
Please see project's package.json
npm run start:dev
# Global install
npm install -g @nestjs/cli
# create project
nest new [name]
# nest new messages
# create module file
nest generate module [name]
# or
# nest g module computer
# nest generate module messages
nest generate service [name]
# nest g service [name]
# create controller file
nest generate controller messages/messages --flat
Request -> Middlewares -> Guards -> Interceptor -> Request Handler (Controller) -> Interceptor -> Response
Global install
npm install -g typescript ts-node
Check
tsc --help
Compile TS file to JS
tsc index.ts # compiled to index.js
Running the File
node index.js
Combining tsc and node in one command:
ts-node index.ts # but will not create any js files
Parcel
npx parcel index.html
Faker
npm install @faker-js/faker