feat: Convert app, server, worker ts files to JS
This commit is contained in:
@@ -2,7 +2,6 @@ import createError from 'http-errors';
|
|||||||
import express from 'express';
|
import express from 'express';
|
||||||
import cors from 'cors';
|
import cors from 'cors';
|
||||||
|
|
||||||
import { IRequest } from '@automatisch/types';
|
|
||||||
import appConfig from './config/app';
|
import appConfig from './config/app';
|
||||||
import corsOptions from './config/cors-options';
|
import corsOptions from './config/cors-options';
|
||||||
import morgan from './helpers/morgan';
|
import morgan from './helpers/morgan';
|
||||||
@@ -38,7 +37,7 @@ app.use(
|
|||||||
express.json({
|
express.json({
|
||||||
limit: appConfig.requestBodySizeLimit,
|
limit: appConfig.requestBodySizeLimit,
|
||||||
verify(req, res, buf) {
|
verify(req, res, buf) {
|
||||||
(req as IRequest).rawBody = buf;
|
req.rawBody = buf;
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
@@ -47,7 +46,7 @@ app.use(
|
|||||||
extended: true,
|
extended: true,
|
||||||
limit: appConfig.requestBodySizeLimit,
|
limit: appConfig.requestBodySizeLimit,
|
||||||
verify(req, res, buf) {
|
verify(req, res, buf) {
|
||||||
(req as IRequest).rawBody = buf;
|
req.rawBody = buf;
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
);
|
);
|
@@ -1,5 +1,3 @@
|
|||||||
import type { Server } from 'http';
|
|
||||||
|
|
||||||
import app from './app';
|
import app from './app';
|
||||||
import appConfig from './config/app';
|
import appConfig from './config/app';
|
||||||
import logger from './helpers/logger';
|
import logger from './helpers/logger';
|
||||||
@@ -7,11 +5,11 @@ import telemetry from './helpers/telemetry';
|
|||||||
|
|
||||||
telemetry.setServiceType('main');
|
telemetry.setServiceType('main');
|
||||||
|
|
||||||
const server: Server = app.listen(appConfig.port, () => {
|
const server = app.listen(appConfig.port, () => {
|
||||||
logger.info(`Server is listening on ${appConfig.baseUrl}`);
|
logger.info(`Server is listening on ${appConfig.baseUrl}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
function shutdown(server: Server) {
|
function shutdown(server) {
|
||||||
server.close();
|
server.close();
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue
Block a user