Skip to content

Instantly share code, notes, and snippets.

@brianleroux
Created May 24, 2012 14:15
Show Gist options
  • Save brianleroux/2781821 to your computer and use it in GitHub Desktop.
Save brianleroux/2781821 to your computer and use it in GitHub Desktop.
var photo = require('./photo')
, app = require('./app')
// GET /api/v1/img ....... list all images
app.get('/api/v1/img', photo.cors, function(req, res) {
photo.thumbs(function(err, photos) {
res.send(photos)
})
})
// POST / ................ uploads a photo
app.post('/', photo.cors, photo.valid, photo.write, function(req, res) {
res.redirect('/')
})
module.exports = app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment