1
0
Fork 0

Add development option to Foxx API install

This commit is contained in:
Alan Plum 2016-11-17 11:29:42 +01:00
parent 93ccc5f218
commit 04d70bbfe8
No known key found for this signature in database
GPG Key ID: 8ED72A9A323B6EFD
1 changed files with 5 additions and 1 deletions

View File

@ -108,18 +108,22 @@ router.get((req, res) => {
router.post(prepareServiceRequestBody, (req, res) => {
const mount = req.queryParams.mount;
fm.install(req.body.source, mount, _.omit(req.queryParams, ['mount']));
fm.install(req.body.source, mount, _.omit(req.queryParams, ['mount', 'development']));
if (req.body.configuration) {
fm.setConfiguration(mount, {configuration: req.body.configuration, replace: true});
}
if (req.body.dependencies) {
fm.setDependencies(mount, {dependencies: req.body.dependencies, replace: true});
}
if (req.queryParams.development) {
fm.development(mount);
}
const service = fm.lookupService(mount);
res.json(serviceToJson(service));
})
.body(schemas.service, ['multipart/form-data', 'application/json'], `Service to be installed.`)
.queryParam('mount', schemas.mount, `Mount path the service should be installed at.`)
.queryParam('development', schemas.flag.default(false), `Enable development mode.`)
.queryParam('setup', schemas.flag.default(true), `Run the service's setup script.`)
.queryParam('legacy', schemas.flag.default(false), `Service should be installed in 2.8 legacy compatibility mode.`)
.response(201, schemas.fullInfo, `Description of the installed service.`)