Nest framework TypeScript connecting to PostgreSQL.
$ npm install
Have PostgreSQL running locally on port 5432
and have database nestjs-users
.
To change connection, modify ormconfig.json
.
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
Use Postman or Insomnia to send API requests:
-
Gets all users from DB
GET /users
-
Get specific user by email
GET /users/:email
-
Create new user
POST /users
{
user: {
firstName: string,
lastName: string,
email: string,
}
}
- Delete user
DELETE /users/:email