DEV Community

Cover image for Deploying Fake Back-End Server & DataBase Using JSON-SERVER, GitHub, and Heroku.

Deploying Fake Back-End Server & DataBase Using JSON-SERVER, GitHub, and Heroku.

Youssef Zidan on December 25, 2020

In this article, we will create and host a fake server that we can deal with it as a normal Back-End Server and use all the CRUD Operations using H...
Collapse
 
kavehkarami profile image
Kaveh Karami

very usefull

Collapse
 
aloksdiptim profile image
alokz diptim!

Thanks! Your "dependencies": {
"json-server": "^0.16.3"
} helped me.

Good one on the pipeline build

Collapse
 
clarencejulu profile image
Clarence Onumajulu

This was so helpful!
I really needed to implement json-server for a project

Collapse
 
cryptozachary profile image
Zachary Lipscomb

Thank you for writing this article - I appreciate your time and effort.

I'm running into a problem - after deploying on heroku , when I run the heroku app, it displays a blank object. I confirmed my database file on heroku is indeed populated. I can't seem to figure out what the issues might be. Any ideas? Heres my github repo for the fork github.com/cryptozachary/nufakeserver

Collapse
 
youssefzidan profile image
Youssef Zidan

my-json-server.typicode.com/typico...

Looks like it's working fine on that link

Collapse
 
cryptozachary profile image
Zachary Lipscomb

I believe that link is for a different user post , not mine. My app link is

nufakerserver.herokuapp.com/

Thread Thread
 
cryptozachary profile image
Zachary Lipscomb

Any ideas? As Im still struggling with solving this problem.

Thanks,

Zachary

Thread Thread
 
youssefzidan profile image
Youssef Zidan

I don't know really.

Collapse
 
jasondev profile image
jasonohdz1501

Great! Thanks very much. I was running into issues trying to deploy my fake server with json-server and I supposed that with my-json-server.typicode.com/ I could perform crud operations, but it's just like a server for read and ephemeral

Collapse
 
olzhas11dev profile image
Olzhas

Thanks a lot!!! Super useful
Just a question, can JSON-SERVER be used for small web app in production?

Collapse
 
youssefzidan profile image
Youssef Zidan

I don't think it's a good idea to do that coz it's fake server after all

Collapse
 
stevepurpose profile image
Stephen Odogwu • Edited

in step 1 can I just watch db.json if I have previously installed json-server globally?.
I mean can I skip this part👇
const router=jsonServer.router('db.json')
..Also can I deploy on netlify or GitHub pages

Collapse
 
ibrahimkamal profile image
Ibrahim Kamal

AWESOME

Collapse
 
cryptozachary profile image
Zachary Lipscomb • Edited

Hello , for anyone reading this article please read below - I need help solving this problem.

After deploying fake json server on heroku , when I run the heroku app, it displays a blank object. I confirmed my database file on heroku is indeed populated. I can't seem to figure out what the issues might be. Any ideas? Heres my github repo for the fork github.com/cryptozachary/nufakeserver

App displaying blank object is located at nufakerserver.herokuapp.com/

Any help would be much appreciated! I'm trying to deploy for a bootcamp project.

Collapse
 
ahmedelhegery profile image
Ahmed Alaa

Great one, Thanks mate!

Collapse
 
youssefzidan profile image
Youssef Zidan

You'r welcome, mate.

Collapse
 
sals1995 profile image
Salsabeel Hussien • Edited

thanks ,I'd like to tell you about this another way
it's more easy with json-server give it a try
my-json-server.typicode.com/

Collapse
 
youssefzidan profile image
Youssef Zidan

that's so cool!

Collapse
 
monisnapjonathan profile image
Jonathan BROSSARD

Great article ! Take a look at miragejs.com/, it could help you to save time :)

Collapse
 
youssefzidan profile image
Youssef Zidan

Cool!
I'll take a look.

Collapse
 
abdulrub profile image
Abdul Rub

Love you brother ,saved my @ss in the last moment