Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
instances: 1
buildpacks:
- https://github.com/cloudfoundry/nodejs-buildpack
instances: 1
buildpacks:
- https://github.com/cloudfoundry/nodejs-buildpack
+ # no-route: true
+ routes:
+ - route: e-mobility-charging-stations-simulator.cfapps.sap.hana.ondemand.com
health-check-type: process
health-check-invocation-timeout: 10
command: node -r source-map-support/register dist/start.cjs
health-check-type: process
health-check-invocation-timeout: 10
command: node -r source-map-support/register dist/start.cjs
"enabled": true,
"type": "jsonfile"
},
"enabled": true,
"type": "jsonfile"
},
+ "uiServer": {
+ "enabled": false,
+ "type": "ws",
+ "authentication": {
+ "enabled": true,
+ "type": "basic-auth",
+ "username": "admin",
+ "password": "admin"
+ }
+ },
"stationTemplateUrls": [
{
"file": "siemens.station-template.json",
"stationTemplateUrls": [
{
"file": "siemens.station-template.json",
);
}
let uiServerConfiguration: UIServerConfiguration = {
);
}
let uiServerConfiguration: UIServerConfiguration = {
type: ApplicationProtocol.WS,
options: {
host: Constants.DEFAULT_UI_WEBSOCKET_SERVER_HOST,
type: ApplicationProtocol.WS,
options: {
host: Constants.DEFAULT_UI_WEBSOCKET_SERVER_HOST,
Configuration.getConfig().uiServer
);
}
Configuration.getConfig().uiServer
);
}
+ if (Configuration.isCFEnvironment() === true) {
+ delete uiServerConfiguration.options.host;
+ uiServerConfiguration.options.port = parseInt(process.env.PORT);
+ }
return uiServerConfiguration;
}
return uiServerConfiguration;
}
+ private static isCFEnvironment(): boolean {
+ return process.env.VCAP_APPLICATION !== undefined;
+ }
+
private static getDefaultPerformanceStorageUri(storageType: StorageType) {
const SQLiteFileName = `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`;
switch (storageType) {
private static getDefaultPerformanceStorageUri(storageType: StorageType) {
const SQLiteFileName = `${Constants.DEFAULT_PERFORMANCE_RECORDS_DB_NAME}.db`;
switch (storageType) {
return item && typeof item === 'object' && Array.isArray(item) === false;
}
return item && typeof item === 'object' && Array.isArray(item) === false;
}
+ private static objectHasOwnProperty(object: unknown, property: string): boolean {
+ return Object.prototype.hasOwnProperty.call(object, property) as boolean;
+ }
+
+ private static isUndefined(obj: unknown): boolean {
+ return typeof obj === 'undefined';
+ }
+
private static deepMerge(target: object, ...sources: object[]): object {
if (!sources.length) {
return target;
private static deepMerge(target: object, ...sources: object[]): object {
if (!sources.length) {
return target;
return Configuration.deepMerge(target, ...sources);
}
return Configuration.deepMerge(target, ...sources);
}
- private static objectHasOwnProperty(object: unknown, property: string): boolean {
- return Object.prototype.hasOwnProperty.call(object, property) as boolean;
- }
-
- private static isUndefined(obj: unknown): boolean {
- return typeof obj === 'undefined';
- }
-
private static handleFileException(
logPrefix: string,
fileType: FileType,
private static handleFileException(
logPrefix: string,
fileType: FileType,