allow apps to push variables from the server to the client

This commit is contained in:
spalger 2015-08-10 14:15:31 -07:00
parent 153e1957c1
commit ea4f0cd474
8 changed files with 36 additions and 15 deletions

View file

@ -47,6 +47,12 @@ module.exports = class Plugin {
let register = (server, options, next) => {
this.server = server;
// bind the server and options to all
// apps created by this plugin
for (let app of this.apps) {
app.getInjectedVars = _.partial(app.getInjectedVars, server, options);
}
server.log(['plugins', 'debug'], {
tmpl: 'Initializing plugin <%= plugin.id %>',
plugin: this