https://github.com/kanokpit-yowaratch/nextjs-api-routes
Creating API Routes in Next.js
https://github.com/kanokpit-yowaratch/nextjs-api-routes
Last synced: 4 months ago
JSON representation
Creating API Routes in Next.js
- Host: GitHub
- URL: https://github.com/kanokpit-yowaratch/nextjs-api-routes
- Owner: kanokpit-yowaratch
- Created: 2024-11-02T23:19:06.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T19:11:45.000Z (8 months ago)
- Last Synced: 2025-01-13T05:42:06.919Z (6 months ago)
- Language: TypeScript
- Homepage: https://nextjs-api-routes-kappa.vercel.app
- Size: 192 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Next.js API Routes
The examples in this project demonstrate how to create different types of APIs in Next.js.
## Getting Started
First, run the development server:
```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```## Main point
Next.js can create API routes in 2 places:
1. In app directory
2. In pages directoryThere are at least four differences between the 2 methods:
1. Folder placement and File naming
2. Function name
3. Request
4. ResponseAnd more: Integration with cookies [readmore](https://suaipisuai.com/post/nextjs-api-routes)