Skip to content

Instantly share code, notes, and snippets.

@botic
Last active November 4, 2015 14:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save botic/e59e57022e6f59505315 to your computer and use it in GitHub Desktop.
Save botic/e59e57022e6f59505315 to your computer and use it in GitHub Desktop.
Ringo HTTP Server docs
var {Server} = require("ringo/httpserver");
var server = new Server();
/* First way: directly providing a function
server.getDefaultContext().serveApplication(function(req) {
return {
status: 200,
headers: {},
body: ["Hello World!"]
};
});
*/
server.getDefaultContext().serveApplication({
appModule: module.resolve("./webapp"),
appName: "foo"
});
server.start();
exports.foo = function() {
return {
status: 200,
headers: {},
body: ["foo(): Hello World!"]
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment