Skip to content

Instantly share code, notes, and snippets.

@isaacs
Created January 11, 2010 03:43
Show Gist options
  • Save isaacs/273982 to your computer and use it in GitHub Desktop.
Save isaacs/273982 to your computer and use it in GitHub Desktop.
chain
(addCustomHeaders)
(errorHandler)
(deflate)
(route
("/foo", chain(fooApp)()) // the () ends the chain
(/^\/blog\/(.*)/, chain(funkyBlogApp)()) // the () ends the chain
(/^\/static\//, chain
(farFutureExpiresHeader)
(route
(/^js\/(.*)\.js$/, chain
(javascriptHeaders)
(jsmin)) // no (), so fall through
(/^css\/(.*)\.css$/, chain
(cssHeaders)
(cssmin))))) // no (), so fall through
(directoryIndex) // if it's a folder, this does
(fileServer)
()
.listen(8000); // this starts the server.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment