From f72d051caa211decd35b682a83c2dcc258abca51 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath <2+defunkt@users.noreply.github.com> Date: Tue, 16 Sep 2025 21:05:40 -0700 Subject: [PATCH] fix everything --- src/server.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/server.tsx b/src/server.tsx index c456ca1..1331022 100644 --- a/src/server.tsx +++ b/src/server.tsx @@ -48,8 +48,12 @@ app.get("/js/:path{.+}", async c => { app.use("*", async (c, next) => { const url = new URL(c.req.url) + const localhost = url.hostname.endsWith("localhost") 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) { const app = serveApp(c, subdomain)