Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions server/controllers/IndividualServices.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ module.exports.readCurrentMacTableFromDevice = async function readCurrentMacTabl
let startTime = process.hrtime();
let responseCode = responseCodeEnum.code.OK;
let responseBodyToDocument = {};

await IndividualServices.readCurrentMacTableFromDevice(body, user, originator, xCorrelator, traceIndicator, customerJourney, req.url)
await IndividualServices.readCurrentMacTableFromDevice(body, user, originator, xCorrelator, traceIndicator, customerJourney)
.then(async function (responseBody) {
responseBodyToDocument = responseBody;
let responseHeader = await ResponseHeader.createResponseHeader(xCorrelator, startTime, req.url);
Expand Down
21 changes: 11 additions & 10 deletions server/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const cp = require('./service/individualServices/CyclicProcessService/cyclicProcess');
const logger = require('./service/LoggingService.js').getLogger();

'use strict';

Expand All @@ -15,14 +16,14 @@ const { env } = require('process');
// uncomment if you do not want to validate security e.g. operation-key, basic auth, etc
//appCommons.openApiValidatorOptions.validateSecurity = false;
if (process.env.DEBUG && process.env.DEBUG.toLowerCase() === "true") {
console.warn("Working in debug mode");
console.warn("Checking validation")
logger.warn("Working in debug mode");
logger.warn("Checking validation")
appCommons.openApiValidatorOptions.validateSecurity = false;
// appCommons.openApiValidatorOptions.validateResponses = false;
// appCommons.openApiValidatorOptions.validateRequests = false;
console.warn("Validate Security: " + appCommons.openApiValidatorOptions.validateSecurity);
console.warn("Validate Responses: " + appCommons.openApiValidatorOptions.validateResponses);
console.warn("Validate Requests: " + appCommons.openApiValidatorOptions.validateRequests);
logger.warn("Validate Security: " + appCommons.openApiValidatorOptions.validateSecurity);
logger.warn("Validate Responses: " + appCommons.openApiValidatorOptions.validateResponses);
logger.warn("Validate Requests: " + appCommons.openApiValidatorOptions.validateRequests);
}

// swaggerRouter configuration
Expand All @@ -39,19 +40,19 @@ appCommons.setupExpressApp(app);

global.databasePath = './database/load.json'
if (process.env.DEBUG && process.env.DEBUG.toLowerCase() === "true") {
console.warn("Working in debug mode");
logger.warn("Working in debug mode");
global.databasePath = './server/database/load.json'
console.warn("Load data from: " + global.databasePath)
logger.warn("Load data from: " + global.databasePath)
}

prepareElasticsearch().catch(err => {
console.error(`Error preparing Elasticsearch : ${err}`);
logger.error(`Error preparing Elasticsearch : ${err}`);
}).finally(
() => {
// Initialize the Swagger middleware
http.createServer(app).listen(serverPort, function () {
console.log('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort);
console.log('Swagger-ui is available on http://localhost:%d/docs', serverPort);
logger.info('Your server is listening on port %d (http://localhost:%d)', serverPort, serverPort);
logger.info('Swagger-ui is available on http://localhost:%d/docs', serverPort);
});
appCommons.performApplicationRegistration();

Expand Down
5 changes: 4 additions & 1 deletion server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@
"oas3-tools": "^2.2.3",
"onf-core-model-ap": "2.1.2",
"onf-core-model-ap-bs": "2.1.2",
"openbackhaul-oas3-tools": "2.3.1-alpha.3"
"openbackhaul-oas3-tools": "2.3.1-alpha.3",
"pino": "^9.4.0",
"pino-pretty": "^11.2.2",
"pino-roll": "^2.2.0"
}
}
5 changes: 4 additions & 1 deletion server/service/HttpClientService.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
'use strict';

// ONF Libs
var fileOperation = require('onf-core-model-ap/applicationPattern/databaseDriver/JSONDriver');
const prepareForwardingAutomation = require('./individualServices/PrepareForwardingAutomation');
const ForwardingAutomationService = require('onf-core-model-ap/applicationPattern/onfModel/services/ForwardingConstructAutomationServices');
const httpClientInterface = require('onf-core-model-ap/applicationPattern/onfModel/models/layerProtocols/HttpClientInterface');

// Custom imports
const prepareForwardingAutomation = require('./individualServices/PrepareForwardingAutomation');

/**
* Returns name of application to be addressed
Expand Down
Loading
Loading