Skip to content

Instantly share code, notes, and snippets.

@erichocean
Created October 21, 2008 23:11
Show Gist options
  • Save erichocean/18464 to your computer and use it in GitHub Desktop.
Save erichocean/18464 to your computer and use it in GitHub Desktop.
//
// A RackJS app is a Function that: responds to .call(), expects "this" as its environment, and returns
// an array with 3 objects: status (a Number), headers (a Hash), and body (an Object that responds to each() or toString())
//
// simplest possible application:
RackJS.Handler.Mongrel.run( function app() { return [200, {}, 'Hello world']; }, { port: 3000 } );
// RackJS will do:
// var env = /* set up the environment */;
// app.call( env );
// whenever it wants a page returned.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment