2022-05-25 18:16:37 +00:00
|
|
|
import { PostgresAppInstance } from 'CommonServer/Infrastructure/PostgresDatabase';
|
|
|
|
import Express, { ExpressApplication } from 'CommonServer/Utils/Express';
|
|
|
|
import logger from 'CommonServer/Utils/Logger';
|
2022-05-24 16:46:21 +00:00
|
|
|
import App from 'CommonServer/Utils/StartServer';
|
2022-05-23 11:45:32 +00:00
|
|
|
import AuthenticationAPI from './API/AuthenticationAPI';
|
|
|
|
|
2022-05-25 18:16:37 +00:00
|
|
|
const app: ExpressApplication = Express.getExpressApp();
|
2022-05-24 16:46:21 +00:00
|
|
|
|
2022-05-25 18:16:37 +00:00
|
|
|
const APP_NAME: string = 'identity';
|
2022-05-24 16:46:21 +00:00
|
|
|
|
2022-05-25 18:16:37 +00:00
|
|
|
app.use([`/${APP_NAME}`, '/'], AuthenticationAPI);
|
|
|
|
|
|
|
|
const init = async () => {
|
|
|
|
try {
|
|
|
|
// init the app
|
|
|
|
await App(APP_NAME);
|
|
|
|
// connect to the database.
|
|
|
|
await PostgresAppInstance.connect(PostgresAppInstance.getDatasourceOptions());
|
|
|
|
} catch (err) {
|
|
|
|
logger.error("App Init Failed:")
|
|
|
|
logger.error(err);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
init();
|
2022-05-08 09:33:54 +00:00
|
|
|
|