Skip to content

Instantly share code, notes, and snippets.

@Raynos
Created August 29, 2012 01:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save Raynos/3505804 to your computer and use it in GitHub Desktop.
Save Raynos/3505804 to your computer and use it in GitHub Desktop.
Content types
var types = ContentTypes({
"json": JsonStreamFactory
, "html": HtmlStreamFactory
})
function requestHandler(req, res) {
types(req, function write(data) {
}, function end() {
}).pipe(res)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment