Skip to content

Instantly share code, notes, and snippets.

@cadorn
Created March 8, 2011 00:17
Show Gist options
  • Select an option

  • Save cadorn/859578 to your computer and use it in GitHub Desktop.

Select an option

Save cadorn/859578 to your computer and use it in GitHub Desktop.
Simple JSGI app
module.declare([], function(require, exports, module)
{
exports.main = function()
{
}
exports.app = function()
{
var counter = 0;
return function(request)
{
counter++;
return {
status: 200,
headers: {
"content-type": "text/plain"
},
body: [
"Counter: " + counter
]
}
};
}
});
{
"main": "main.js"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment