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)