A progressive Node.js framework for building efficient and scalable server-side applications.
Nest framework TypeScript starter repository.
# Download the official postgres docker image and run a container
$ docker run --name vcpdb-pg -p 5432:5432 -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=postgres -e POSTGRES_DB=vcpdb -d postgreshost: localhost
port: 5432
database: vcpdb
user: postgres
password: postgres
$ npm install# watch mode
$ npm run start:devNOTE: TypeOrm is set with the flag synchronize=true, which enables the creation of the tables with the execution of the above command..
The API service runs in the port 3007.
# Initial data for Role, User and Videos
$ npm run seedGo to http://localhost:3007/api to watch the endpoints and play around with them.
NOTE: The only way I discovered to ensure the API consumption via Cookie authentication was to get directly the generated cookie by the endpoint: /authentication/signin, it comes within the Response Headers and you must set the cookie in the browser (Javascript console):
document.cookie = 'Authentication=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOjMsInJvbGVOYW1lIjoiU3R1ZGVudCIsImlhdCI6MTY1ODMzOTY2NiwiZXhwIjoxNjU4MzQzMjY2fQ.tIqAxRRiFTsV25dyvZdNhM38YL3T0eOYEQ1rECDhM2w; Max-Age=3600s'
You can use any of the user registered by the seeds, for example:
Username: clementine@yesenia.net
Password 12345
Every user's password is the same: 12345
Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here.
- Author - Kamil Myśliwiec
- Website - https://nestjs.com
- Twitter - @nestframework
Nest is MIT licensed.
