sails
Version:
API-driven framework for building realtime apps, using MVC conventions (based on Express and Socket.io)
29 lines (22 loc) • 424 B
JavaScript
module.exports = function(sails) {
var phrase;
return {
defaults: {
__configKey__: {
phrase: 'make it rain'
}
},
initialize: function(cb) {
phrase = sails.config[this.configKey].phrase;
this.isShoutyHook = true;
cb();
},
routes: {
before: {
'GET /shout': function(req, res, next) {
res.send(phrase);
}
}
}
};
};