https://github.com/zackartz/blog
https://github.com/zackartz/blog
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zackartz/blog
- Owner: zackartz
- License: bsd-3-clause
- Created: 2020-07-25T01:00:53.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-25T01:23:39.000Z (almost 6 years ago)
- Last Synced: 2025-08-19T02:57:01.062Z (10 months ago)
- Language: CSS
- Size: 229 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API routes with REST
Next.js ships with [API routes](https://github.com/vercel/next.js#api-routes), which provide an easy solution to build your own `API`. This example shows how it can be used to create your [REST](https://en.wikipedia.org/wiki/Representational_state_transfer) api.
## Deploy your own
Deploy the example using [Vercel](https://vercel.com):
[](https://vercel.com/import/project?template=https://github.com/vercel/next.js/tree/canary/examples/api-routes-rest)
## How to use
### Using `create-next-app`
Execute [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app) with [npm](https://docs.npmjs.com/cli/init) or [Yarn](https://yarnpkg.com/lang/en/docs/cli/create/) to bootstrap the example:
```bash
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](https://vercel.com/import?filter=next.js&utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).