This looks fantastic. The link to the framework itself is https://github.com/walmartlabs/hapi.
In particular, I'm excited about the way endpoints are registered:
// Define the route
var hello = {
handler: function (request) {
request.reply({ greeting: 'hello world' });
}
};
// Add the route
server.addRoute({
method: 'GET',
path: '/hello',
config: hello
});
This makes it extremely easy to expose API endpoints to internal modules. Let's
say your company has a module related to simple math operations -- exposing this
externally is as simple as adding a 'handler' method. var SimpleMath = new function() {
var module = this;
module.divide = function(a, b) {
return a / b;
};
module.multiply = function(a, b) {
return a * b;
};
// Now add the external handler.
module.handler = function(request) {
// somehow access two variables, a and b
request.reply({
product: module.multiply(a, b);
quotient: module.divide(a, b);
});
}