mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-21 22:59:07 +00:00
Refactor initialization code and add WorkflowFeatureSet to App/Index.ts
This commit is contained in:
parent
b88320bcbb
commit
59a6771e73
@ -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.
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user