+ const body: InstallOrUpdatePlugin = req.body
+
+ const fromDisk = !!body.path
+ const toInstall = body.npmName || body.path
+ try {
+ const plugin = await PluginManager.Instance.install(toInstall, undefined, fromDisk)
+
+ return res.json(plugin.toFormattedJSON())
+ } catch (err) {
+ logger.warn('Cannot install plugin %s.', toInstall, { err })
+ return res.sendStatus(400)
+ }
+}