Printer Logo

Printer

Creating API Routes

The API route generates a baseline structure for you to develop REST endpoints. It uses iron-session and utilizes the pre generated session token. Nothing special, but definitely a timesaver.

λ Usage
λ printer api [path]
λ Example Usage
λ printer api example
λ This command then creates
λ pages/api/example.tsx
λ ...
λ printer api multi/folder/example
λ This command then creates
λ pages/api/multi/folder/example.tsx

This then generates in the file pages/api/example.tsx the following code.