Skip to content

Commit b71849f

Browse files
authored
Merge pull request #52 from debugger22/heroku
Host on Heroku
2 parents 6773ac9 + 556096f commit b71849f

File tree

6 files changed

+15
-3
lines changed

6 files changed

+15
-3
lines changed

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,5 @@ jspm_packages
3838

3939
# Optional for people who uses JetBrains products
4040
*.idea
41+
42+
dump.rdb

Procfile

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
web: node server

README.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -64,14 +64,17 @@ Note: Without the GitHub oauth key the number of requests is throttled at 60 per
6464
Run Redis and Server
6565
----------
6666

67+
If you are running locally then run local redis server
68+
6769
```bash
6870
$ redis-server
6971
```
7072

73+
On heroku, you can set up `Heroku Redis` add-on and it sets `REDIS_URL` enviornment variable.
74+
7175
In a separate window:
7276
```bash
7377
$ node server
7478
```
7579

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

app/index.html

-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ <h4>About</h4>
9191
developed by <a href="https://github.com/debugger22" target="_blank">@debugger22</a><br/><br/>
9292
<div id="coinwidget-bitcoin-37XgcaBrHibCMHzvZeZcj5mX5kYn8LUnui"></div><br/>
9393
ProTip: It's actually kind of nice to leave on the background<br/><br/>
94-
<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>
9594
</div>
9695
<div class="footer-right-text-block">
9796
inspired by <a href="http://hatnote.com" target="_blank">hatnote</a><br/>

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,8 @@
3232
"redis": "^2.6.2",
3333
"request": "^2.75.0",
3434
"socket.io": "^1.4.8"
35+
},
36+
"engines": {
37+
"node": "4.x"
3538
}
3639
}

server/index.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,12 @@ var helmet = require('helmet'); // To change response headers
1111

1212
// To temporarily store JSON data from GitHub and also
1313
// the number of connected users
14-
var redis = require("redis"),
14+
var redis = require("redis");
15+
if (process.env.REDIS_URL) {
16+
redis_client = redis.createClient(process.env.REDIS_URL);
17+
} else {
1518
redis_client = redis.createClient();
19+
}
1620

1721
var path = require('path');
1822

0 commit comments

Comments
 (0)