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://",