fix everything

This commit is contained in:
Chris Wanstrath 2025-09-16 21:05:40 -07:00
parent 7541a89541
commit f72d051caa

View File

@ -48,8 +48,12 @@ app.get("/js/:path{.+}", async c => {
app.use("*", async (c, next) => { app.use("*", async (c, next) => {
const url = new URL(c.req.url) const url = new URL(c.req.url)
const localhost = url.hostname.endsWith("localhost")
const domains = url.hostname.split(".") const domains = url.hostname.split(".")
const subdomain = domains.length > 1 ? domains[0]! : "" let subdomain = ""
if (domains.length > (localhost ? 1 : 2))
subdomain = domains[0]!
if (subdomain) { if (subdomain) {
const app = serveApp(c, subdomain) const app = serveApp(c, subdomain)