How to Deploy db.json Mock Server on Render || Host JSON server on GitHub | Host JSON API on Server

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone welcome to my channel in this video I'm going to show you how you can deploy your db.jsl file into your own Json server so you can see we have created this endpoint where you can hit and do all the post patch put delete request in this in short you can create all the crude operations here on this endpoint and this is your own data you can add as much as data you want in this resources so why do we need this suppose we are creating any projects and you are storing your data into db.json form so there when you will deploy your project into website like netlify or version or some other websites you will find that your db.json data is not deployed well so in order to fix that tissue we have come with the solution that we will deploy dp.json manually and then we can use this and point to do fetch request or xcos request and we can get all the data from there it is very easy to deploy your data into this format and then you can use this data anywhere in your projects so uh just follow my steps so let's get started so in order to do that you need to go to your GitHub here you can create a new Repository click on this new button and then you can write the name of your repository suppose I am writing project data then you need to select the owner for this repository so I am selecting myself as the owner make sure you make this repository public and then you can hit on this button create repository now your repository has been created now you need to go to your vs code you can open the terminal from here the repository is an online directory in order to use the repository we will need to clone this repository first so for that we will write the command to get clone then copy the links from here paste it and hit enter now you can see that your repository has been flowed so in order to go inside this folder you need to write CD and the repository name so now you are inside your git repository the first step is to add package.json file in order to do that write this command npm in it hyphen y now this command will create packet.json data folder go inside this and you can see this so this packet.json is missing some dependency so we need to install it so write npm I Json server so you need to install all this dependency after writing this command hit enter it will take some time you need to write here one command which is start here you need to write node index.js so now you are done with packet.json file all you need to do is you need to create this index.js file so in order to do that click on this button and write index.js so I will provide you this URL in my description box all you need to do is follow me from here and you can make this repository as star foreign [Music] so you can see this index.js just go there and you can see this 10 line of code all you need to do is copy the code from here once it is copied paste it here now you are done with index.js file also you can see this node modules so what you need to do is you need to add one more file hit ignore and here you write node modules just create bp.json file now the final step is to add all the data that you need to deploy for that write it in a curly braces suppose this is the data that I want to deploy I will copy it and I will paste it here you need to write a name suppose I write smartphone so now once you have added all the data that you need to deploy you will need to follow this simple three commands which is git add git commit then git push original name you can see that the data has been posted in our git repository now once you will go there and refresh it all the changes that we have made is being updated here now in order to deploy that you need to go to this website render you can see this firstly render.com just click on it if you are entering this website for the first time you can click on this button get started for free sign up this website with your GitHub account and then you will get this kind of email so it will ask you to verify your email you can click on this link and your email will be verified so after doing all these steps you need to go so here you can see your previous deployed data as well as you can add the new data from visual so click on this button new then go to web service now for here you can see connect your repository so here you will find all that GitHub repository which you have in your account if you don't find all your repository here you can go to this config account and you can connect your name with this so all this repository will be present here so just now we have created this project data and we need to connect this so hit on that button connect and just give it a name so here you can give any name and then come down and here you will find create web services click on it then you will get this data in progress it means your data is being deployed wait for it it will take some time foreign [Music] you may have this doubt that What if after some time I fell down this much data is not enough and I want more so what you can do you can add a comma here and you can bring uh whatever data you want to add suppose this you can copy this data and paste it here you need to write a name so once you have updated your db.json all you need to do is you need to write three commands which is git add git commute get push originally now once your data has been pushed successfully you can find your data will be updated here as well as when you will go to this render you will find that your data is automatically deployed you don't need to worry about you no need to worry about deploying again once the data is updated on your git account GitHub account it will be automatically updated here so this is all for today I hope you like this video and if you have any doubt you can ask me in the comment section below thank you so much
Info
Channel: Suman's Academy
Views: 17,902
Rating: undefined out of 5
Keywords: Sumansacademy, sumansacademy, Host JSON server on GitHub, How to Deploy db.json Mock Server, How to deploy JSON server on render for free 2023, render deployment failed, json mock server, json server, node js server, deploy json server to netlify, deploy json server to versel
Id: wN0n2gj0z9o
Channel Id: undefined
Length: 9min 18sec (558 seconds)
Published: Wed Feb 22 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.