diff options
Diffstat (limited to 'hooks/server/mod.ts')
-rw-r--r-- | hooks/server/mod.ts | 40 |
1 files changed, 3 insertions, 37 deletions
diff --git a/hooks/server/mod.ts b/hooks/server/mod.ts index b635b05..0a520f9 100644 --- a/hooks/server/mod.ts +++ b/hooks/server/mod.ts @@ -1,37 +1,3 @@ -import { - getRequiredEnv, - getStdout, - type HealthCheckInput, - HealthCheckOutput, - type IEither, - type ITraceable, - LogTraceable, - TraceUtil, -} from "@emprespresso/pengueno"; - -export class LizCIServer { - private constructor( - private readonly healthCheckActivity = HealthCheckActivity(healthCheck), - private readonly jobHookActivity = JobHookActivity(jobQueuer), - private readonly fourOhFourActivity = FourOhFourActivity(), - ) {} - - private async route(req: LogTraceable<Request>) { - return req.flatMap((req) => { - const { item: request } = req; - const url = new URL(request.url); - if (url.pathname === "/health") { - return this.healthCheckActivity.healthCheck(req); - } - if (url.pathname === "/job") { - return this.jobHookActivity.processHook(req); - } - }); - } - - public async serve(req: Request): Promise<Response> { - return LogTraceable(req).bimap(TraceUtil.withClassTrace(this)).map( - this.route, - ); - } -} +export * from "./ci.ts"; +export * from "./health.ts"; +export * from "./job/mod.ts"; |