summaryrefslogtreecommitdiff
path: root/u/server/activity/fourohfour.ts
diff options
context:
space:
mode:
authorElizabeth Alexander Hunt <me@liz.coffee>2025-05-18 22:54:15 -0700
committerElizabeth Alexander Hunt <me@liz.coffee>2025-05-18 22:55:20 -0700
commitd54e91c6582ed160cf2f2fcf977e48b4439d133b (patch)
tree5669367c4fa49bc0373b0c581ea3027218fd5e32 /u/server/activity/fourohfour.ts
parent9cf3fc0259730b7dcf47b3ab4a04369e39fb4614 (diff)
downloadci-theBigRefactor.tar.gz
ci-theBigRefactor.zip
Diffstat (limited to 'u/server/activity/fourohfour.ts')
-rw-r--r--u/server/activity/fourohfour.ts27
1 files changed, 18 insertions, 9 deletions
diff --git a/u/server/activity/fourohfour.ts b/u/server/activity/fourohfour.ts
index 48740df..6449abd 100644
--- a/u/server/activity/fourohfour.ts
+++ b/u/server/activity/fourohfour.ts
@@ -1,4 +1,5 @@
import {
+ type IActivity,
type ITraceable,
JsonResponse,
type PenguenoRequest,
@@ -16,12 +17,20 @@ const messages = [
"ヽ(;▽;)ノ Eep! This route has ghosted you~",
];
const randomFourOhFour = () => messages[Math.random() * messages.length];
-export const FourOhFourActivity = (
- req: ITraceable<PenguenoRequest, ServerTrace>,
-) =>
- req
- .move(
- new JsonResponse(req, randomFourOhFour(), {
- status: 404,
- }),
- );
+
+export interface IFourOhFourActivity {
+ fourOhFour: IActivity;
+}
+
+export class FourOhFourActivityImpl implements IFourOhFourActivity {
+ public fourOhFour(
+ req: ITraceable<PenguenoRequest, ServerTrace>,
+ ) {
+ return req
+ .move(
+ new JsonResponse(req, randomFourOhFour(), { status: 404 }),
+ )
+ .map((resp) => Promise.resolve(resp.get()))
+ .get();
+ }
+}