Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
-const isCi = process.env.CI !== undefined;
-const isCloudFoundry = process.env.VCAP_APPLICATION !== undefined;
-if (!isCloudFoundry && !isCi) {
+const isCIEnvironment = process.env.CI !== undefined;
+const isCFEnvironment = process.env.VCAP_APPLICATION !== undefined;
+if (isCFEnvironment === false && isCIEnvironment === false) {
// eslint-disable-next-line node/no-unpublished-require
require('husky').install();
}
http = require('http'),
serveStatic = require('serve-static');
-const PORT = process.env.PORT || 3030,
+const isCFEnvironment = process.env.VCAP_APPLICATION !== undefined,
+ PORT = isCFEnvironment ? parseInt(process.env.PORT) : 3030,
uiPath = path.join(__dirname, './dist');
const serve = serveStatic(uiPath);