Skip to content

Latest commit

 

History

History

route-handlers

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Basic API routes example

Next.js ships with Route Handlers which provides an easy solution to build your own API. This example shows how to create multiple API endpoints with serverless functions, which can execute independently.

Deploy your own

Deploy the example using Vercel or preview live with StackBlitz

Deploy with Vercel

How to use

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

npx create-next-app --example route-handlers route-handlers-app
yarn create next-app --example route-handlers route-handlers-app
pnpm create next-app --example route-handlers route-handlers-app

Deploy it to the cloud with Vercel (Documentation).