mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-06 01:45:18 +00:00
Using new needed method named awaitMigration() before init the Wazuh app
This commit is contained in:
parent
2978098aaf
commit
a3103954dd
33
init.js
33
init.js
@ -18,13 +18,32 @@ import { Monitoring } from './server/monitoring';
|
||||
import { WazuhApiRoutes } from './server/routes/wazuh-api';
|
||||
import { WazuhReportingRoutes } from './server/routes/wazuh-reporting';
|
||||
import { WazuhUtilsRoutes } from './server/routes/wazuh-utils';
|
||||
import { log } from './server/logger';
|
||||
|
||||
export function initApp(server) {
|
||||
Initialize(server);
|
||||
WazuhElasticRouter(server);
|
||||
WazuhApiElasticRoutes(server);
|
||||
Monitoring(server, false);
|
||||
WazuhApiRoutes(server);
|
||||
WazuhReportingRoutes(server);
|
||||
WazuhUtilsRoutes(server);
|
||||
log(
|
||||
'[initApp]',
|
||||
`Waiting for awaitMigration()`,
|
||||
'info'
|
||||
);
|
||||
server.kibanaMigrator.awaitMigration()
|
||||
.then(() => {
|
||||
log(
|
||||
'[initApp]',
|
||||
`awaitMigration() has been executed successfully`,
|
||||
'info'
|
||||
);
|
||||
Initialize(server);
|
||||
WazuhElasticRouter(server);
|
||||
WazuhApiElasticRoutes(server);
|
||||
Monitoring(server, false);
|
||||
WazuhApiRoutes(server);
|
||||
WazuhReportingRoutes(server);
|
||||
WazuhUtilsRoutes(server);
|
||||
}).catch(error => {
|
||||
log(
|
||||
'[initApp]',
|
||||
`initApp function failed due to: ${error.message || error}`
|
||||
);
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user