Permalink
Browse files

/img and better logging

  • Loading branch information...
wadey committed Nov 2, 2011
1 parent 548a2e1 commit 0466fb0f9eb76e1bd34a57562bd98582a71c9a7a
Showing with 10 additions and 2 deletions.
  1. +3 −0 app.js
  2. +2 −1 lib/image.js
  3. +5 −1 routes/index.js
View
3 app.js
@@ -33,6 +33,9 @@ app.configure('production', function(){
// Routes
app.get('/', routes.index);
+app.get('/img', routes.img);
+app.get('/img.jpg', routes.img);
+app.get('/img.jpeg', routes.img);
if (require.main === module) {
app.listen(process.env.PORT || 3000);
View
@@ -67,7 +67,7 @@ function applyOverlay(image, options, callback) {
args.push('-flatten')
args.push('jpg:-')
- console.log(args.join(' '))
+ // console.log(args.join(' '))
var proc = im.convert(args, function(err, stdout, stdin) {
if (err) return callback(err)
@@ -82,6 +82,7 @@ function applyOverlay(image, options, callback) {
exports.mash = function(data, callback){
cache(data, function(data, callback) {
+ console.log('overlay:', data.overlay, 'image:', data.image)
async.parallel(
{
face: async.apply(faceDetect, data.image),
View
@@ -1,6 +1,10 @@
var image = require('../lib/image')
-exports.index = function(req, res, next){
+exports.index = function(req, res, next) {
+ return res.send('Index coming soon, check out /img?src=...&overlay=hipster', {'Content-Type': 'text/plain'}, 200)
+}
+
+exports.img = function(req, res, next) {
var data = {
image: req.param('src', 'http://www.librarising.com/astrology/celebs/images2/QR/queenelizabethii.jpg'),
overlay: req.param('overlay', 'mustache')

0 comments on commit 0466fb0

Please sign in to comment.