Skip to content

Instantly share code, notes, and snippets.

@robi42
Created September 14, 2011 22:43
Show Gist options
  • Save robi42/1218031 to your computer and use it in GitHub Desktop.
Save robi42/1218031 to your computer and use it in GitHub Desktop.
var {Application} = require('stick');
var response = require('ringo/jsgi/response');
var app = exports.app = Application();
app.configure('notfound', 'error', 'params', 'route');
app.get('/', function (req) {
return response.json(req.params);
});
if (require.main === module) {
require('ringo/httpserver').main(module.id);
}
// $ ringo app.js
// $ curl http://localhost:8080/?foo=bar
// $ {"foo":"bar"}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment