Skip to content

Instantly share code, notes, and snippets.

@tobyhede
Created March 15, 2011 12:19
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save tobyhede/870658 to your computer and use it in GitHub Desktop.
Mimesis - Simple Test Server in 10 lines
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