Skip to content

Instantly share code, notes, and snippets.

@technoweenie
Created February 3, 2010 18:37
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 technoweenie/16786e61a9e1559d0aab to your computer and use it in GitHub Desktop.
Save technoweenie/16786e61a9e1559d0aab to your computer and use it in GitHub Desktop.
// 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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment