A progressive Node.js framework for building efficient and scalable server-side applications.
- Nota: El UsersModule se puede eliminar del AuthModule (auth.module.ts) y funcionaria exactamente igual, porque lo unico que necesitamos es el UsersService que tendremos que incluirlo en el auth.module.ts:
import { UsersService } from '../users/users.service';
...
providers: [AuthService, UsersService, LocalStrategy],
- main: Estrategia Local.
- jwt : Estrategia jwtStrategy
Nest framework TypeScript starter repository.
$ # POST to /auth/login
$ curl -X POST http://localhost:3000/auth/login -d '{"username": "john", "password": "changeme"}' -H "Content-Type: application/json"
$ # result -> {"access_token":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."}
$ # Note: above JWT truncated
$ # POST to /
$ # curl -X POST http://localhost:3000 -d '{"username": "reza@gmail.com", "password": "123456"}' -H "Content-Type: application/json"
$ npm install
# 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
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.