From d682b07fa5470071dd228581db8b117ca20b797a Mon Sep 17 00:00:00 2001 From: dangered wolf Date: Sun, 12 Nov 2023 19:50:31 -0500 Subject: [PATCH] Make API routes more lenient (maybe #483?) --- src/realms/api/router.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/realms/api/router.ts b/src/realms/api/router.ts index da5a967..25ade4d 100644 --- a/src/realms/api/router.ts +++ b/src/realms/api/router.ts @@ -7,10 +7,14 @@ import { Constants } from '../../constants'; export const api = new Hono(); /* Current v1 API endpoints. Currently, these still go through the Twitter embed requests. API v2+ won't do this. */ -api.get('/status/:id/:language?', statusRequest); -api.get('/status/:id/:language?/', statusRequest); -api.get('/:handle/status/:id/:language?', statusRequest); -api.get('/:handle/status/:id/:language?/', statusRequest); +api.get('/status/:id', statusRequest); +api.get('/status/:id/', statusRequest); +api.get('/status/:id/:language', statusRequest); +api.get('/status/:id/:language/', statusRequest); +api.get('/:handle/status/:id', statusRequest); +api.get('/:handle/status/:id/', statusRequest); +api.get('/:handle/status/:id/:language', statusRequest); +api.get('/:handle/status/:id/:language/', statusRequest); api.get('/robots.txt', async c => c.text(Strings.ROBOTS_TXT_API)); api.get('/:handle', profileRequest);