Skip to content
This repository was archived by the owner on Mar 22, 2018. It is now read-only.
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
2 changes: 2 additions & 0 deletions .buildpacks
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
https://github.com/heroku/heroku-buildpack-nodejs.git
https://github.com/stomita/heroku-buildpack-phantomjs.git
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: node app
18 changes: 18 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,24 @@ setInterval(poller, 60000);

Every minute, this script will refresh the two screenshots `google.png` and `yahoo.png`.

## Deploying to Heroku

This repository can be deployed directly to [Heroku](https://www.heroku.com). It requires both Node and Phantom, so we need to use multiple buildpacks.

```bash
$ heroku create --buildpack=https://github.com/ddollar/heroku-buildpack-multi.git
```

The `$PATH` will not be correct, but we can fix that.
```bash
$ heroku config:set PATH=/app/bin:/app/node_modules/bin:/usr/local/bin:/usr/bin:/bin:/app/vendor/phantomjs/bin
```

Now we can deploy normally.
```bash
$ git push heroku master
```

## TODO

* Allow to configure phantomjs options through YAML config
Expand Down
4 changes: 4 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var express = require('express');
var RasterizerService = require('./lib/rasterizerService');
var FileCleanerService = require('./lib/fileCleanerService');

if (process.env.PORT) {
config.server.port = process.env.PORT;
}

process.on('uncaughtException', function (err) {
console.error("[uncaughtException]", err);
process.exit(1);
Expand Down