outmoded / university

Community learning experiment
Other
371 stars 194 forks source link

assignment3 #113

Closed haikyuu closed 9 years ago

haikyuu commented 9 years ago
haikyuu commented 9 years ago

Thanks @AdriVanHoudt . I borrowed your test which alters the register function of the plugin, nice trick (i totally forgot that the required modules were cached).

haikyuu commented 9 years ago

Wouldn't it be nice if we required all the plugins in the lib folder and registered them once. We could use require-dir or something like

Fs.readdirSync(__dirname).filter(function(file) {

        return ((file !== 'index.js') && (file.indexOf('.js') !== -1);
    }).forEach(function(file) {
        internals.plugins.push(require(Path.join(__dirname, file)));
    });
AdriVanHoudt commented 9 years ago

@haikyuu np and we register them once right now...

haikyuu commented 9 years ago

@AdriVanHoudt i meant that we shouldn't have to update the index.js file every time we add a plugin.

AdriVanHoudt commented 9 years ago

@haikyuu seems logical to me, since every plugin has specific options, we can however in the future use https://github.com/hapijs/glue