A progressive Node.js framework for building efficient and scalable server-side applications.
Autenticação (Sistema de Login) com Token JWTAntes de iniciar, certifique-se de que você possui um projeto NestJS criado e que a CLI do NestJS está instalada no seu computador.
npm install -D prisma
npx prisma init
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema
datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
}
model User {
id Int @id @default(autoincrement())
email String @unique
password String
name String
}
# Configuration
JWT_SECRET=""
# Database
DATABASE_URL=""
# Configuration
JWT_SECRET="texto aleatório para proteger sua aplicação"
# Database
DATABASE_URL="file:./sqlite.db"
npx prisma migrate dev --name init
Esse comando deverá instalar a dependência @prisma/client
no projeto.
Nest framework TypeScript starter repository.
$ 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.