silverwolf-x/project / examples /api-routes-cors
32.9 GB
31,201 files
Updated 2 months ago
Name
Size
pages
.gitignore437 Bytes
xet
README.md1.29 kB
xet
package.json421 Bytes
xet
tsconfig.json599 Bytes
xet
README.md

API Routes Example with CORS

Next.js ships with API routes which provides an easy solution to build your own API.

This example shows how to create an API endpoint with CORS headers, using the cors package.

Deploy your own

Deploy with Vercel

How to use

Execute create-next-app with npm, Yarn, or pnpm to bootstrap the example:

npx create-next-app --example api-routes-cors api-routes-cors-app
yarn create next-app --example api-routes-cors api-routes-cors-app
pnpm create next-app --example api-routes-cors api-routes-cors-app

Deploy it to the cloud with Vercel (Documentation).

Total size
32.9 GB
Files
31,201
Last updated
Sep 26
Pre-warmed CDN
US EU US EU

Contributors