Created
September 14, 2011 22:43
-
-
Save robi42/1218031 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
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