From 433ffba1e3c32bde82286bcca4463f5ddeab9834 Mon Sep 17 00:00:00 2001 From: tresabhi Date: Wed, 5 Jul 2023 01:16:19 +0000 Subject: [PATCH] feat: added route suffix to routes --- src/routes/stats.tsx | 4 ++-- src/server.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/routes/stats.tsx b/src/routes/stats.tsx index 3ce638a67..71cd12053 100644 --- a/src/routes/stats.tsx +++ b/src/routes/stats.tsx @@ -3,7 +3,7 @@ import resolvePlayerFromRequest from '../core/express/resolvePlayerFromRequest.j import stats, { StatType } from '../renderers/stats.js'; import { RouteRegistry } from '../server.js'; -export default { +export const statsRoute: RouteRegistry = { route: '/stats/:type/:period', inProduction: true, inDevelopment: false, @@ -21,4 +21,4 @@ export default { true, ); }, -} satisfies RouteRegistry; +}; diff --git a/src/server.ts b/src/server.ts index 660710863..c2ed63b6d 100644 --- a/src/server.ts +++ b/src/server.ts @@ -3,7 +3,7 @@ import normalizeRouteReturnable from './core/express/normalizeRouteReturnable.js import withAutoRefresh from './core/express/withAutoRefresh.js'; import isDev from './core/node/isDev.js'; import { Registry } from './events/interactionCreate/index.js'; -import stats from './routes/stats.js'; +import { statsRoute } from './routes/stats.js'; export type RouteReturnable = JSX.Element | Promise; @@ -20,7 +20,7 @@ export interface RouteRegistry const app = express(); -([stats] as RouteRegistry[]).forEach((registry) => { +([statsRoute] as RouteRegistry[]).forEach((registry) => { if (!(isDev() ? registry.inDevelopment : registry.inProduction)) return; app.get(registry.route, async (req, res) => {