Refactor initialization code and add WorkflowFeatureSet to App/Index.ts

This commit is contained in:
Simon Larsen 2024-04-24 19:17:38 +01:00
parent b88320bcbb
commit 59a6771e73
No known key found for this signature in database
GPG Key ID: AB45983AA9C81CDE
2 changed files with 5 additions and 9 deletions

View File

@ -19,9 +19,6 @@ const APP_NAME: string = 'api/workflow';
const WorkflowFeatureSet: FeatureSet = {
init: async (): Promise<void> => {
try {
const componentCodeAPI: ComponentCodeAPI = new ComponentCodeAPI();
componentCodeAPI.init();
const app: ExpressApplication = Express.getExpressApp();
app.use(`/${APP_NAME}/manual`, new ManualAPI().router);
@ -38,6 +35,9 @@ const WorkflowFeatureSet: FeatureSet = {
}
);
const componentCodeAPI: ComponentCodeAPI = new ComponentCodeAPI();
componentCodeAPI.init();
app.use(`/${APP_NAME}`, componentCodeAPI.router);
// Job process.

View File

@ -61,16 +61,12 @@ const init: PromiseVoidFunction = async (): Promise<void> => {
await DocsRoutes.init();
await BaseAPIRoutes.init();
await APIReferenceRoutes.init();
await Workers.init();
await Workflow.init();
// home should be in the end because it has the catch all route.
await HomeRoutes.init();
// init workers
await Workers.init();
// init workflow
await Workflow.init();
// add default routes
await App.addDefaultRoutes();
} catch (err) {