https://github.com/zomars/api-routes-json-server
https://github.com/zomars/api-routes-json-server
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/zomars/api-routes-json-server
- Owner: zomars
- Created: 2021-05-04T21:12:23.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-05-04T21:12:30.000Z (about 5 years ago)
- Last Synced: 2025-03-24T00:52:16.975Z (about 1 year ago)
- Language: JavaScript
- Homepage: api-routes-json-server.vercel.app
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic API routes example
Next.js ships with [API routes](https://nextjs.org/docs/api-routes/introduction) 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](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example):
[](https://vercel.com/new/git/external?repository-url=https://github.com/vercel/next.js/tree/canary/examples/api-routes&project-name=api-routes&repository-name=api-routes)
## How to use
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 api-routes-app
# or
yarn create next-app --example api-routes api-routes-app
```
Deploy it to the cloud with [Vercel](https://vercel.com/new?utm_source=github&utm_medium=readme&utm_campaign=next-example) ([Documentation](https://nextjs.org/docs/deployment)).