start with plugins
This commit is contained in:
@@ -40,6 +40,7 @@ const defaultSettings = {
|
|||||||
{ href: '/', label: 'home' },
|
{ href: '/', label: 'home' },
|
||||||
{ href: '/about', label: 'about' }
|
{ href: '/about', label: 'about' }
|
||||||
],
|
],
|
||||||
|
plugins: [],
|
||||||
admin_email: config.admin_email || '',
|
admin_email: config.admin_email || '',
|
||||||
smtp: config.smtp || {}
|
smtp: config.smtp || {}
|
||||||
}
|
}
|
||||||
@@ -117,6 +118,7 @@ const settingsController = {
|
|||||||
const plugin = require(path.resolve(plugins_path, pluginFile))
|
const plugin = require(path.resolve(plugins_path, pluginFile))
|
||||||
if (typeof plugin.load !== 'function') return
|
if (typeof plugin.load !== 'function') return
|
||||||
plugin.load({ settings: settingsController.settings })
|
plugin.load({ settings: settingsController.settings })
|
||||||
|
settingsController.settings.plugins.push(plugin)
|
||||||
log.info(`Plugin ${pluginFile} loaded!`)
|
log.info(`Plugin ${pluginFile} loaded!`)
|
||||||
if (typeof plugin.onEventCreate === 'function') {
|
if (typeof plugin.onEventCreate === 'function') {
|
||||||
notifier.emitter.on('Create', plugin.onEventCreate)
|
notifier.emitter.on('Create', plugin.onEventCreate)
|
||||||
|
|||||||
Reference in New Issue
Block a user