Skip to content
This repository has been archived by the owner on Mar 22, 2018. It is now read-only.

Update app to support PhantomJS 2.x #80

Open
wants to merge 1 commit into
base: master
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
16 changes: 8 additions & 8 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ process.on('SIGINT', function () {

// web service
var app = express();
app.configure(function(){
app.use(express.static(__dirname + '/public'))
app.use(app.router);
app.set('rasterizerService', new RasterizerService(config.rasterizer).startService());
app.set('fileCleanerService', new FileCleanerService(config.cache.lifetime));
});
app.configure('development', function() {
app.use(express.static(__dirname + '/public'));
app.use(app.router);
app.set('rasterizerService', new RasterizerService(config.rasterizer).startService());
app.set('fileCleanerService', new FileCleanerService(config.cache.lifetime));

if (app.get('env') == 'development') {
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }));
});
}

require('./routes')(app, config.server.useCors);
app.listen(config.server.port, config.server.host);
console.log('Express server listening on ' + config.server.host + ':' + config.server.port);
10 changes: 7 additions & 3 deletions scripts/rasterizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@
*
* This starts an HTTP server waiting for screenshot requests
*/
var basePath = phantom.args[0] || '/tmp/';
var system = require('system');

var port = phantom.args[1] || 3001;
var args = system.args;

var defaultViewportSize = phantom.args[2] || '';
var basePath = system.args[1] || '/tmp/';

var port = system.args[2] || 3001;

var defaultViewportSize = system.args[3] || '';
defaultViewportSize = defaultViewportSize.split('x');
defaultViewportSize = {
width: ~~defaultViewportSize[0] || 1024,
Expand Down