Files
app/ts/index.ts
T

30 lines
1.0 KiB
TypeScript
Raw Normal View History

import * as plugins from './plugins.js';
import * as paths from './paths.js';
import { Reception } from './reception/classes.reception.js';
2024-09-29 13:56:38 +02:00
export const runCli = async () => {
const serviceQenv = new plugins.qenv.Qenv('./', './.nogit', false);
const websiteServer = new plugins.typedserver.utilityservers.UtilityWebsiteServer({
feedMetadata: null,
domain: 'idp.global',
serveDir: paths.distWebDir,
addCustomRoutes: async (typedserver) => {
// Enable SPA fallback - serves index.html for non-file routes (e.g., /login, /dashboard)
typedserver.options.spaFallback = true;
},
2024-09-29 13:56:38 +02:00
});
// lets add the reception routes
const reception = new Reception({
name: (await serviceQenv.getEnvVarOnDemand('INSTANCE_NAME')) || 'idp.global',
mongoDescriptor: {
2025-11-30 23:09:40 +00:00
mongoDbUrl: await serviceQenv.getEnvVarOnDemand('MONGODB_URL'),
},
websiteServer: websiteServer,
baseUrl: await serviceQenv.getEnvVarOnDemand('IDP_BASEURL'),
});
await reception.start();
2024-09-29 13:56:38 +02:00
await websiteServer.start();
};