-
-
Save technoweenie/16786e61a9e1559d0aab to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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