https://github.com/minikin/json-server
Fake Json Server hosted on Heroku
https://github.com/minikin/json-server
heroku json server
Last synced: about 2 months ago
JSON representation
Fake Json Server hosted on Heroku
- Host: GitHub
- URL: https://github.com/minikin/json-server
- Owner: minikin
- License: mit
- Created: 2019-09-06T08:40:55.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-06-11T08:23:32.000Z (about 5 years ago)
- Last Synced: 2025-10-10T14:27:33.675Z (9 months ago)
- Topics: heroku, json, server
- Language: JavaScript
- Homepage: https://minikin-json-server.herokuapp.com
- Size: 236 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Json Server
### Deploy to Heroku
1 . [Create your database](#create-your-database)
2 . Create an account on
[https://heroku.com](https://heroku.com)
3 . Install the Heroku CLI on your computer:
[https://devcenter.heroku.com/articles/heroku-cli](https://devcenter.heroku.com/articles/heroku-cli)
4 . Connect the Heroku CLI to your account by writing the following command in your terminal and follow the instructions on the command line:
```bash
heroku login
```
5 . Then create a remote heroku project, kinda like creating a git repository on GitHub. This will create a project on Heroku with a random name. If you want to name your app you have to supply your own name like `heroku create project-name`:
```bash
heroku create my-cool-project
```
6 . Push your app to __Heroku__ (you will see a wall of code)
```bash
git push heroku master
```
7 . Visit your newly create app by opening it via heroku:
```bash
heroku open
```
8 . For debugging if something went wrong:
```bash
heroku logs --tail
```
---
#### How it works
Heroku will look for a startup-script, this is by default `npm start` so make sure you have that in your `package.json` (assuming your script is called `server.js`):
```json
"scripts": {
"start" : "node server.js"
}
```
You also have to make changes to the port, you can't hardcode a dev-port. But you can reference herokus port. So the code will have the following:
```js
const port = process.env.PORT || 4000;
```