Created
March 15, 2011 12:19
-
-
Save tobyhede/870658 to your computer and use it in GitHub Desktop.
Mimesis - Simple Test Server in 10 lines
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
http = require('http') | |
http.createServer( (req, res) -> | |
[ out, statusCode ] = req.url.split("/")[1..2] | |
res.writeHead(statusCode or 200, 'Content-Type': 'text/plain') | |
res.end(out or req.url) | |
).listen(3000, "127.0.0.1") | |
console.log("Mimesis Started (http://127.0.0.1:3000/)") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment