A progressive Node.js framework for building efficient and scalable server-side applications with typescript.
Building a simple coffee App with nestjs.
To create a new controller with nestjs cli
nest generate controller
# short form
nest g co
To create a new service with nestjs cli
nest generate service
# short form
nest g s
$ yarn install
# development
$ yarn run start
# watch mode
$ yarn run start:dev
# production mode
$ yarn run start:prod
# unit tests
$ yarn run test
# e2e tests
$ yarn run test:e2e
# test coverage
$ yarn run test:cov
when connecting to heroku-postgresql
from localhost via nestjs TypeOrm module,
the connection will be rejected if ssl:true
option is not passed and it'll reject
connection for self signed certificated too.
so, to avoid these issues add ssl rejectUnauthorized
to false
{
"name": "default",
"type": "postgres",
"url": "postgres://username:password@host:port/database",
"synchronize": true,
"ssl": true,
"extra": {
"ssl": {
"rejectUnauthorized": false
}
}
}