Skip to content

Make deployable to heroku; then it''ll be truly 30s to start as promised #309

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,18 @@ server.use('/api', router)

You can deploy JSON Server. For example, [JSONPlaceholder](http://jsonplaceholder.typicode.com) is an online fake API powered by JSON Server and running on Heroku.

#### Deploying to Heroku

```
heroku create
git push heroku master
heroku open
```

Alternatively, you can deploy your own copy of the app using this button:

[![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy)

## Links

### Video
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"test": "npm run test:cli && npm run test:server && standard",
"test:cli": "NODE_ENV=test mocha -R spec test/cli/*.js",
"test:server": "NODE_ENV=test mocha -R spec test/server/*.js",
"start": "node bin",
"start": "node bin --watch db.json",
"prepush": "npm t"
},
"repository": {
Expand Down
3 changes: 2 additions & 1 deletion src/cli/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ var pkg = require('../../package.json')
module.exports = function () {

updateNotifier({ pkg: pkg }).notify()
var portDefault = process.env.PORT || 3000 // heroku provides the port to bind to

var argv = yargs
.config('config')
Expand All @@ -14,7 +15,7 @@ module.exports = function () {
port: {
alias: 'p',
description: 'Set port',
default: 3000
default: portDefault
},
host: {
alias: 'H',
Expand Down