secret

  • Download Gist
gistfile1.txt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
// assume redis is running on the default port
var sys = require('sys'),
api = require('./lib/api').create(),
PORT = 3456
 
api
.addListener('request', function(req, status) {
sys.puts(req.method + " " + req.url + ' => ' + status)
})
 
.addListener('locate', function(user, location) {
sys.puts("LOCATE " + user + ' => ' + location)
})
 
.addListener('list', function(location, users) {
sys.puts("LIST " + location + " => " + users.join(", "))
})
 
.addListener('track', function(user, location) {
sys.puts("TRACK " + user + " => " + location)
})
 
api.listen(PORT);
 
sys.puts("Starting Where's Waldo server on port " + PORT)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.