json-server
to {{ free hosting site }}
Deploy 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.
Create your database
- Press the green
Use this template
-button in the right corner of this repo - 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!"
}
]
}
Deploy to Glitch
Not tested 100%. Same as with Heroku, will sleep after a while.
- Register for Glitch or go to Glitch/edit
- Click New Project
- Click Import from GitHub
- Paste
https://github.com/harryandriyan/form-builder-db
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://seemly-truthful-scribe.glitch.me/
. And your DB will be athttps://seemly-truthful-scribe.glitch.me/posts