-
-
Save victusfate/702496 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var connect = require('connect') | |
, sys = require('sys'); | |
var webapp = function(req, res) { | |
var path = req.url.split('/'); | |
this[path[1]].apply(this, path.slice(2)); | |
res.writeHead(200, { 'Content-Type': 'text/plain' }); | |
res.end(sys.inspect(this)); | |
}; | |
connect.createServer(webapp.bind([])).listen(8000); | |
// ^^^^^^^^^^^^^^^ | |
// | (x) | |
// ROFLSCALE DB ---/ | |
// http://localhost:8000/push/1 -> [ '1' ] | |
// http://localhost:8000/push/2 -> [ '1', '2' ] | |
// http://localhost:8000/push/3 -> [ '1', '2', '3' ] | |
// http://localhost:8000/toString -> [ '1', '2', '3' ] | |
// http://localhost:8000/pop -> [ '1', '2' ] | |
// http://localhost:8000/shift -> [ '2' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment