Instructions how to deploy the full fake REST API json-server to various free hosting sites. Should only be used in development purpose but can act as a simpler database for smaller applications.
- Press the green
Use this template
-button in the right corner - Give your new repo a name and press the green
Create repository from template
-button - Clone your newly created repository to your computer
4 . Change the contents of db.json
to your own content according to the json-server example
and then commit
your changes to git locally.
this example will create /posts
route , each resource will have id
, title
and content
. id
will auto increment!
{
"posts":[
{
"id" : 0,
"title": "First post!",
"content" : "My first content!"
}
]
}
Website will sleep after a while.
- Register for Glitch or go to Glitch/edit
- Click New Project
- Click Import from GitHub
- Paste
https://github.com/jesperorb/json-server-heroku.git
into the URL-input and click OK. - Wait for it to setup
- Press Share-button to get your URL to live site. It should be something for example like:
https://fallabe-pie-snake.glitch.me
. And your DB will be athttps://fallabe-pie-snake.glitch.me/posts