Skip to content

Instantly share code, notes, and snippets.

@lambtron
Created February 19, 2013 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambtron/4983651 to your computer and use it in GitHub Desktop.
Save lambtron/4983651 to your computer and use it in GitHub Desktop.
// Importing modules.
var express = require('express');
var fs = require('fs');
var image = require('./image');
// Configuration.
var app = express();
app.set('views', __dirname + '/views');
app.set('view engine', 'jade');
app.use('/resources', express.static(__dirname + '/resources'));
app.use(express.bodyParser());
// Open port.
var port = process.env.PORT || 3000;
app.listen(port);
console.log('listening on port 3000');
// Root route.
app.get('/', function(req, res){
// Change filename from output.jpg to tumblr.jpg
image.createImage( function() {
res.render('index.jade', {output: 'resources/output.jpg'});
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment