From 9e3e02cabdd70ca56fa5bb7d158b07951820e34e Mon Sep 17 00:00:00 2001 From: Jesse Wierzbinski Date: Mon, 15 Apr 2024 00:54:35 -1000 Subject: [PATCH] refactor(frontend): :art: Make glitch-soc be served on / not on /web --- server.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/server.ts b/server.ts index 5564bec4..8b57b8b6 100644 --- a/server.ts +++ b/server.ts @@ -117,16 +117,6 @@ export const createServer = ( ); } - if (config.frontend.glitch.enabled) { - // Proxy all /web requests to Glitch-Soc - if ( - new URL(req.url).pathname.startsWith("/web") || - new URL(req.url).pathname.startsWith("/packs") - ) { - return await handleGlitchRequest(req, dualLogger); - } - } - // If route is .well-known, remove dot because the filesystem router can't handle dots for some reason const matchedRoute = matchRoute( req.url.replace(".well-known", "well-known"), @@ -135,6 +125,11 @@ export const createServer = ( return await processRoute(matchedRoute, req, logger); } + if (config.frontend.glitch.enabled) { + // Proxy all /web requests to Glitch-Soc + return await handleGlitchRequest(req, dualLogger); + } + const base_url_with_http = config.http.base_url.replace( "https://", "http://",