rsnext/examples/api-routes-rest
Joe Haddad 7d038dfef1
Suggest npx over npm init (#13637)
This updates old examples to the more universal `npx` command.

Fixes https://github.com/vercel/next.js/discussions/12103
2020-06-01 17:36:57 +00:00
..
pages Update Examples for Fast Refresh (#13068) 2020-05-18 17:44:18 -04:00
package.json Update api-rest-example to SSG (#11362) 2020-03-28 13:27:17 -05:00
README.md Suggest npx over npm init (#13637) 2020-06-01 17:36:57 +00:00

API routes with REST

Next.js ships with API routes, which provide an easy solution to build your own API. This example shows how it can be used to create your REST api.

Deploy your own

Deploy the example using Vercel:

Deploy with Vercel

How to use

Using create-next-app

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

npx create-next-app --example api-routes-rest api-routes-rest-app
# or
yarn create next-app --example api-routes-rest api-routes-rest-app

Deploy to Now

Deploy it to the cloud with Vercel (Documentation).