refactor(frontend): 🎨 Make glitch-soc be served on / not on /web

This commit is contained in:
Jesse Wierzbinski 2024-04-15 00:54:35 -10:00
parent ff6a91f916
commit 9e3e02cabd
No known key found for this signature in database

View file

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