Last active
November 4, 2015 14:53
-
-
Save botic/e59e57022e6f59505315 to your computer and use it in GitHub Desktop.
Ringo HTTP Server docs
This file contains 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 {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(); |
This file contains 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
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