mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
refactor(frontend): 🎨 Make glitch-soc be served on / not on /web
This commit is contained in:
parent
ff6a91f916
commit
9e3e02cabd
15
server.ts
15
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
|
// If route is .well-known, remove dot because the filesystem router can't handle dots for some reason
|
||||||
const matchedRoute = matchRoute(
|
const matchedRoute = matchRoute(
|
||||||
req.url.replace(".well-known", "well-known"),
|
req.url.replace(".well-known", "well-known"),
|
||||||
|
|
@ -135,6 +125,11 @@ export const createServer = (
|
||||||
return await processRoute(matchedRoute, req, logger);
|
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(
|
const base_url_with_http = config.http.base_url.replace(
|
||||||
"https://",
|
"https://",
|
||||||
"http://",
|
"http://",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue