webstudio/server/src/main.ts

28 lines
984 B
TypeScript
Raw Normal View History

2023-10-26 17:44:54 +03:00
import "reflect-metadata";
import { App } from "./core/controllers/app";
2023-10-27 21:22:48 +03:00
import { Routes } from "./core/interfaces/router";
2023-10-26 17:44:54 +03:00
import { TriggerPresentation } from "./features/triggers/triggers_presentation";
import { ProjectsPresentation } from "./features/projects/projects_presentation";
2023-10-27 21:22:48 +03:00
import { PipelinePresentation } from "./features/pipelines/pipeline_presentation";
import { ProcessPresentation } from "./features/process/process_presentation";
2023-11-10 12:06:40 +03:00
import { SocketSubscriber } from "./core/controllers/socket_controller";
import {
RealTimePresentation,
pipelineRealTimeService,
} from "./features/realtime/realtime_presentation";
2023-10-26 17:44:54 +03:00
const httpRoutes: Routes[] = [
new TriggerPresentation(),
new ProjectsPresentation(),
2023-10-27 21:22:48 +03:00
new ProcessPresentation(),
new PipelinePresentation(),
2023-11-10 12:06:40 +03:00
new RealTimePresentation(),
2023-10-26 17:44:54 +03:00
].map((el) => el.call());
2023-11-10 12:06:40 +03:00
const socketSubscribers = [
new SocketSubscriber(pipelineRealTimeService, "realtime"),
];
2023-10-26 17:44:54 +03:00
2023-11-10 12:06:40 +03:00
new App(httpRoutes, socketSubscribers).listen();
2023-11-10 21:43:57 +03:00