silverwolf-x's picture
|
download
raw
1.29 kB

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).

Xet Storage Details

Size:
1.29 kB
·
Xet hash:
a1f2fa32300db60fd7156d0e75394b4049a23a80db78b2bd77fcbc0f5cc00a17

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.