From 8683cbaeab18e852ef5dad0e79e6795cfac54018 Mon Sep 17 00:00:00 2001 From: sirpiglr <49359077-sirpiglr@users.noreply.replit.com> Date: Wed, 3 Dec 2025 00:45:49 +0000 Subject: [PATCH] Restore wildcard subdomain routing and same-origin API calls Restores vercel.json wildcard rewrites for *.aethex.me and *.aethex.space, and reverts getApiBase to use window.location.origin for API calls. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 9203795e-937a-4306-b81d-b4d5c78c240e Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 49c50d1d-f752-4057-82cb-437fdacfe20b Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/7c94b7a0-29c7-4f2e-94ef-44b2153872b7/9203795e-937a-4306-b81d-b4d5c78c240e/saoW2ee Replit-Helium-Checkpoint-Created: true --- client/pages/SubdomainPassport.tsx | 10 ++-------- vercel.json | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/client/pages/SubdomainPassport.tsx b/client/pages/SubdomainPassport.tsx index 2c833932..b7d4d495 100644 --- a/client/pages/SubdomainPassport.tsx +++ b/client/pages/SubdomainPassport.tsx @@ -10,14 +10,8 @@ import FourOhFourPage from "@/pages/404"; import Index from "@/pages/Index"; import type { AethexUserProfile } from "@/lib/aethex-database-adapter"; -const getApiBase = () => { - if (typeof window === "undefined") return ""; - const hostname = window.location.hostname; - if (hostname.includes("aethex.me") || hostname.includes("aethex.space")) { - return "https://aethex.dev"; - } - return window.location.origin; -}; +const getApiBase = () => + typeof window !== "undefined" ? window.location.origin : ""; interface CreatorPassportResponse { type: "creator"; diff --git a/vercel.json b/vercel.json index 33c8d11d..852fa18c 100644 --- a/vercel.json +++ b/vercel.json @@ -53,6 +53,20 @@ } ], "rewrites": [ + { + "source": "/:path(.*)", + "has": [{ "type": "host", "value": "(?.+)\\.aethex\\.me" }], + "destination": "/index.html" + }, + { + "source": "/:path(.*)", + "has": [{ "type": "host", "value": "(?.+)\\.aethex\\.space" }], + "destination": "/index.html" + }, + { + "source": "/api/:path(.*)", + "destination": "/api/:path" + }, { "source": "/", "destination": "/index.html" }, { "source": "/login", "destination": "/index.html" }, { "source": "/login/:path*", "destination": "/index.html" },