Skip to content

Commit

Permalink
Merge pull request debugger22#52 from debugger22/heroku
Browse files Browse the repository at this point in the history
Host on Heroku
  • Loading branch information
OrkoHunter authored Mar 14, 2019
2 parents 6773ac9 + 556096f commit b71849f
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,5 @@ jspm_packages

# Optional for people who uses JetBrains products
*.idea

dump.rdb
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node server
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ Note: Without the GitHub oauth key the number of requests is throttled at 60 per
Run Redis and Server
----------

If you are running locally then run local redis server

```bash
$ redis-server
```

On heroku, you can set up `Heroku Redis` add-on and it sets `REDIS_URL` enviornment variable.

In a separate window:
```bash
$ node server
```

Note: For production run `export NODE_ENV="production"` before starting the server.

1 change: 0 additions & 1 deletion app/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ <h4>About</h4>
developed by <a href="https://github.com/debugger22" target="_blank">@debugger22</a><br/><br/>
<div id="coinwidget-bitcoin-37XgcaBrHibCMHzvZeZcj5mX5kYn8LUnui"></div><br/>
ProTip: It's actually kind of nice to leave on the background<br/><br/>
<a href="https://www.digitalocean.com/" target="_blank"><img style="width:150px;cursor: pointer;" src="https://www.digitalocean.com/assets/media/logos-badges/DO_Powered_by_Badge_white-a05c38f6.png" alt="DigitalOcean" /></a>
</div>
<div class="footer-right-text-block">
inspired by <a href="http://hatnote.com" target="_blank">hatnote</a><br/>
Expand Down
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,8 @@
"redis": "^2.6.2",
"request": "^2.75.0",
"socket.io": "^1.4.8"
},
"engines": {
"node": "4.x"
}
}
6 changes: 5 additions & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,12 @@ var helmet = require('helmet'); // To change response headers

// To temporarily store JSON data from GitHub and also
// the number of connected users
var redis = require("redis"),
var redis = require("redis");
if (process.env.REDIS_URL) {
redis_client = redis.createClient(process.env.REDIS_URL);
} else {
redis_client = redis.createClient();
}

var path = require('path');

Expand Down

0 comments on commit b71849f

Please sign in to comment.