Running a dummy database from a deployed app

Whenever I build a quick frontend prototype in JavaScript, I tend to run a dummy database response for the backend. Recently, I deployed one of these prototypes to Heroku and realized that you cannot run the dummy database in Heroku’s console. To get around this you’d either host another Heroku app for the backend or alternatively you can push the dummy to its own git repository and and run it through My JSON Server. You can find the link for more an in depth look here, but you won’t need to.

Once you’ve deployed your db.json file by itself to GitHub, you can start requesting pulls from it by inputting this link https://my-json-server.typicode.com/<your-github-username>/<your-dummy-repo-name> to access your server. You never have to sign up for the website or visit it after deploying your repository. You would pull info from your api the same way you typically would. So an example fetch call URL would look like

my-json-server.typicode.com/<your-github-username>/<repo-name>/<your-request>/<id>

It’s easy and it’s quick. Enjoy!