Created
October 21, 2008 23:11
-
-
Save erichocean/18464 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// | |
// 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