Skip to content

Instantly share code, notes, and snippets.

@chapel
Created November 29, 2010 05:52
Show Gist options
  • Save chapel/719626 to your computer and use it in GitHub Desktop.
Save chapel/719626 to your computer and use it in GitHub Desktop.
var app = require('express').createServer()
urls = ['http://i.imgur.com/M75xU.jpg',
'http://i.imgur.com/sKhEM.jpg',
'http://i.imgur.com/ZvgN0.jpg',
'http://i.imgur.com/PsRlb.jpg',
'http://i.imgur.com/RxOTo.jpg',
'http://i.imgur.com/Fr22q.jpg']
app.get('/', function(req, res){
res.send('');
})
app.get('/add/user/:id', function(req, res){
res.send('user '+req.params.id)
})
app.get('/add/avatar/:id', function(req, res){
res.send('avatar: '+req.params.id)
})
app.listen(8000)
urls[Math.round(Math.random()*(urls.length-1))]
console.log("Server running at http://127.0.0.1:8000/")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment