Skip to content

Commit

Permalink
feature: add per plugin config get route (#567)
Browse files Browse the repository at this point in the history
If a plugin is a web app that needs access to the configuration
data it should be able to retrieve just its own config,
not the configs for all the plugins, which was previously
the case.
  • Loading branch information
tkurki authored and sbender9 committed Jun 24, 2018
1 parent f15d73d commit 16bcddd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/interfaces/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -309,6 +309,10 @@ module.exports = function (app) {
})
})

router.get('/config', (req, res) => {
res.json(getPluginOptions(plugin.id))
})

if (typeof plugin.registerWithRouter !== 'undefined') {
plugin.registerWithRouter(router)
}
Expand Down

0 comments on commit 16bcddd

Please sign in to comment.