oneuptime/Accounts/Serve.ts

28 lines
679 B
TypeScript
Raw Normal View History

2022-05-24 16:46:21 +00:00
import App from 'CommonServer/Utils/StartServer';
2022-12-29 15:50:53 +00:00
import Express, { ExpressApplication } from 'CommonServer/Utils/Express';
2022-11-10 18:50:20 +00:00
import logger from 'CommonServer/Utils/Logger';
2019-09-09 13:30:52 +00:00
2022-05-25 22:03:45 +00:00
export const APP_NAME: string = 'accounts';
const app: ExpressApplication = Express.getExpressApp();
2023-08-09 17:02:00 +00:00
const init: () => Promise<void> = async (): Promise<void> => {
2022-11-10 18:50:20 +00:00
try {
// init the app
2022-12-29 15:50:53 +00:00
await App(APP_NAME, undefined, true);
2022-11-10 18:50:20 +00:00
} catch (err) {
logger.error('App Init Failed:');
logger.error(err);
2023-10-04 18:22:25 +00:00
throw err;
2022-11-10 18:50:20 +00:00
}
};
2023-08-09 17:02: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-09 17:02:00 +00:00
});
2022-11-10 18:50:20 +00:00
2022-05-13 10:50:24 +00:00
export default app;