No description
  • JavaScript 73%
  • Python 27%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
2024-01-15 09:13:25 +07:00
.github Initial commit 2024-01-13 21:04:48 +07:00
api Update main.py 2024-01-15 09:13:25 +07:00
.gitignore Initial commit 2024-01-13 21:04:48 +07:00
db.json Initial commit 2024-01-13 21:04:48 +07:00
LICENSE Initial commit 2024-01-13 21:04:48 +07:00
package.json Update directory 2024-01-13 22:28:53 +07:00
pnpm-lock.yaml Implement youtube-api 2024-01-13 22:06:31 +07:00
README.md Initial commit 2024-01-13 21:04:48 +07:00
requirements.txt Implement youtube-api 2024-01-13 22:06:31 +07:00
vercel.json test 2024-01-13 22:37:29 +07:00

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:

  1. https://json-server-in.vercel.app
  2. https://json-server-in.vercel.app/api/posts

Powered by Vercel

How to use

  1. Click "Use this template" or clone this repository.
  2. Update or use the default db.json in the repository.
  3. Sign Up or login into Vercel.
  4. From the Vercel dashboard, click "+ New Project" then "Import" your repository.
  5. In the "Configure Project" screen, leave everything default and click "Deploy".
  6. 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.

Reference

  1. https://github.com/typicode/json-server
  2. https://vercel.com
  3. https://shadowsmith.com/how-to-deploy-an-express-api-to-vercel