Browse Source

Await migration before running server

pull/1/head
rozetko 6 years ago
parent
commit
e894272f40
  1. 10
      server/src/index.ts

10
server/src/index.ts

@ -14,12 +14,14 @@ import * as Koa from 'koa';
import * as Router from 'koa-router';
import * as bodyParser from 'koa-bodyparser';
init();
async function init() {
await convertPanelUrlToPanelId();
AnalyticsController.init();
ProcessService.registerExitHandler(AnalyticsController.terminate);
convertPanelUrlToPanelId();
var app = new Koa();
const app = new Koa();
app.on('error', (err, ctx) => {
console.log('got server error:');
@ -49,7 +51,7 @@ app.use(async function(ctx, next) {
});
var rootRouter = new Router();
const rootRouter = new Router();
rootRouter.use('/analyticUnits', analyticUnitsRouter.routes(), analyticUnitsRouter.allowedMethods());
rootRouter.use('/segments', segmentsRouter.routes(), segmentsRouter.allowedMethods());
rootRouter.use('/threshold', thresholdRouter.routes(), thresholdRouter.allowedMethods());
@ -83,4 +85,4 @@ app
app.listen(HASTIC_PORT, () => {
console.log(`Server is running on :${HASTIC_PORT}`);
});
}

Loading…
Cancel
Save