Before you start, please create a GitHub account and a Heroku account.
Use this repository as a starting point, as it contains some extra stuff to facilitate with deploying a JSON Server API to Heroku. The only file that you'll need to modify is db.json
.
Please read the instructions on the README for how to run the JSON Server API locally.
To deploy your API to Heroku, follow the instructions below:
- Log into GitHub and click on the "Fork" button on this repository. Next, click on the "Create fork" button.
- Log in to Heroku and go to the Apps dashboard and select "New" > "Create new app".
- Give your app a name and click the "Create app" button.
- Under "Deployment method", select "Connect to GitHub". Search for your forked repository and click "Connect".
- Click on "Enable Automatic Deploys". This will ensure that whenever you make changes to your forked repository, they will be automatically deployed to Heroku.
- Click on "Deploy Branch".
- Once the deployment has finished, click on "Open app" at the top of the page in the upper right corner. You should see a JSON Server welcome page. Now modify the URL path to access your GET API endpoints.