diff options
author | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:54:15 -0700 |
---|---|---|
committer | Elizabeth Alexander Hunt <me@liz.coffee> | 2025-05-18 22:55:20 -0700 |
commit | d54e91c6582ed160cf2f2fcf977e48b4439d133b (patch) | |
tree | 5669367c4fa49bc0373b0c581ea3027218fd5e32 /hooks/server/mod.ts | |
parent | 9cf3fc0259730b7dcf47b3ab4a04369e39fb4614 (diff) | |
download | ci-theBigRefactor.tar.gz ci-theBigRefactor.zip |
snapshottheBigRefactor
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"; |