mirror of
https://github.com/Nezumi-2711/json-server-vercel.git
synced 2026-09-23 13:03:41 +00:00
No description
- JavaScript 73%
- Python 27%
| Filename | Latest commit message | Latest commit date |
|---|---|---|
| .github | ||
| api | ||
| .gitignore | ||
| db.json | ||
| LICENSE | ||
| package.json | ||
| pnpm-lock.yaml | ||
| README.md | ||
| requirements.txt | ||
| vercel.json | ||
Deploy JSON Server to Vercel
A template to deploy JSON Server to Vercel, allow you to run fake REST API online!
Demo from this repository:
How to use
- Click "Use this template" or clone this repository.
- Update or use the default
db.jsonin the repository. - Sign Up or login into Vercel.
- From the Vercel dashboard, click "+ New Project" then "Import" your repository.
- In the "Configure Project" screen, leave everything default and click "Deploy".
- Wait until deployment is done, and your own JSON server is ready to serve!
Default db.json
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
Enable write operations
By default, only GET operation is allowed, thanks to the contribution by @VicAv99 at #6, we can now enable write operations as well.
You can find the example code in api/server.js.