Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/juliocesarscheidt/nestjs-api-rest
https://github.com/juliocesarscheidt/nestjs-api-rest
nestjs prisma rest typescript
Last synced: 8 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/juliocesarscheidt/nestjs-api-rest
- Owner: juliocesarscheidt
- Created: 2024-02-04T07:12:34.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-05T03:53:16.000Z (12 months ago)
- Last Synced: 2024-12-01T07:31:57.140Z (2 months ago)
- Topics: nestjs, prisma, rest, typescript
- Language: TypeScript
- Homepage:
- Size: 102 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
```bash
nest new nestjs-api-rest
yarn install
yarn run start:dev
yarn build
# generate a new controller
# nest g controller products
# generate a new service
# nest g service products# generate all resources related to products
nest g resource products# prisma orm
npx prisma inityarn add prisma -D
yarn add @prisma/clientnpx prisma generate
# prisma/schema.prisma
npx prisma migrate dev# DATABASE_URL="mysql://user:password@localhost:3306/nestjs_api_rest?charset=utf8mb4"
// import { PrismaClient } from '@prisma/client'
// const prisma = new PrismaClient()npx prisma format
# generate a new module
nest g module prismanest g service prisma
# object validation
yarn add class-validator class-transformer --save# add filters - advice
nest g filter not-found-error
nest g filter server-error
nest g filter unprocessable-entity# generate all resources related to stock-inputs
nest g resource stock-inputs
nest g resource stock-outputsyarn add @nestjs/throttler --save
```