Printer Logo

Printer

Creating CRUD API Routes

The CRUD command creates new API routes based around a Prisma model. For example running “printer crud user” will generate the routes create, update, list, get, delete with the Prisma model “User” binded to it.

λ Usage
λ printer crud [model name]
λ Example Usage
λ printer crud user
λ ...
λ This command then creates
λ pages/api/user/create.tsx
λ pages/api/user/update.tsx
λ pages/api/user/get.tsx
λ pages/api/user/list.tsx
λ pages/api/user/delete.tsx

These are samples of the auto generated code.