oneuptime/AdminDashboard/Serve.ts

27 lines
675 B
TypeScript
Raw Normal View History

2023-08-25 14:20:00 +00:00
import App from 'CommonServer/Utils/StartServer';
import Express, { ExpressApplication } from 'CommonServer/Utils/Express';
import logger from 'CommonServer/Utils/Logger';
2023-09-05 09:32:18 +00:00
export const APP_NAME: string = 'admin';
2023-08-25 14:20:00 +00:00
const app: ExpressApplication = Express.getExpressApp();
const init: () => Promise<void> = async (): Promise<void> => {
try {
// init the app
await App(APP_NAME, undefined, true);
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
2023-10-04 18:22:25 +00:00
throw err;
2023-08-25 14:20:00 +00:00
}
};
init().catch((err: Error) => {
logger.error(err);
2023-10-04 18:22:25 +00:00
logger.info('Exiting node process');
2023-09-27 19:48:50 +00:00
process.exit(1);
2023-08-25 14:20:00 +00:00
});
export default app;