From 9859ef8913245dbde6829ccee002df029abe6e69 Mon Sep 17 00:00:00 2001 From: xangelo Date: Fri, 20 Oct 2023 23:09:27 -0400 Subject: [PATCH] feat: extend Express.Request to include base RL object The `rl` property on `Express.Request` provides a standard way to access the cache and socket server objects across requests. This allows us to split up the routes into multiple files for easier development. --- src/types/express/index.d.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/types/express/index.d.ts b/src/types/express/index.d.ts index 9f12cde..f04dcbf 100644 --- a/src/types/express/index.d.ts +++ b/src/types/express/index.d.ts @@ -1,7 +1,14 @@ import { Player } from '../../shared/player'; +import { Server } from 'socket.io'; + +interface RL { + cache: Map, + io: Server +} declare module 'express-serve-static-core' { interface Request { - player: Player + player: Player, + rl: RL } } -- 2.25.1