https://github.com/umasahni/render-json-server
Learn to deploy your json server on render.com from this repository
https://github.com/umasahni/render-json-server
api deployment jsonserver render
Last synced: 1 day ago
JSON representation
Learn to deploy your json server on render.com from this repository
- Host: GitHub
- URL: https://github.com/umasahni/render-json-server
- Owner: UmaSahni
- Created: 2023-02-21T20:36:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-24T11:18:05.000Z (over 1 year ago)
- Last Synced: 2025-04-06T20:24:55.441Z (27 days ago)
- Topics: api, deployment, jsonserver, render
- Language: JavaScript
- Homepage: https://youtu.be/wN0n2gj0z9o
- Size: 66.4 KB
- Stars: 124
- Watchers: 1
- Forks: 24
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# render-json-server
## Watch This Video
[](http://www.youtube.com/watch?v=wN0n2gj0z9o)Hello everyone in this video you will learn to deploy your db.json file on **render.com** step by step.
**Step 1** - Create git repository
**Step 2** - Clone it on your device
**Step 3** - Add package.json by using this command `npm init -y`
**Step 4** - Install some dependency by using this command `npm i json-server cors json-serve` and add ` "start": "node index.js" ` in script
**Step 6** - Create index.js file copy the code from my GitHub repository
```javaScript
const jsonServer = require("json-server"); // importing json-server library
const server = jsonServer.create();
const router = jsonServer.router("db.json");
const middlewares = jsonServer.defaults();
const port = process.env.PORT || 8080; // chose port from here like 8080, 3001server.use(middlewares);
server.use(router);server.listen(port);
```
**Step 7** - Add db.json and add .gitignore file
After all this steps are completed use this command to push the code in your Github account.
`git add .`
`git commit -m "Your message"`
`git push origin main`
If you find this video helpful please subscribe to my channel and share this with your friends. If you have any queries ask in the comment section below I will be happy to answer you all.