Fix backend URL in development mode

This commit is contained in:
Aurelsicoko 2018-01-17 14:13:31 +01:00
parent e90f0b5858
commit ecc7fe0b83
2 changed files with 5 additions and 1 deletions

View File

@ -48,4 +48,4 @@
"npm": ">= 3.0.0"
},
"license": "MIT"
}
}

View File

@ -74,6 +74,10 @@ if (isAdmin && !isSetup) {
if (_.get(server, 'admin.build.plugins.source') === 'backend') {
URLs.mode = 'backend';
}
if (process.env.npm_lifecycle_event === 'start') {
URLs.backend = `http://${_.get(server, 'host', 'localhost')}:${_.get(server, 'port', 1337)}`;
}
}
} catch (e) {
throw new Error(`Impossible to access to ${serverConfig}`)