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
This commit is contained in:
sirpiglr 2025-12-03 00:45:49 +00:00
parent b6838d0cd8
commit 8683cbaeab
2 changed files with 16 additions and 8 deletions

View file

@ -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";

View file

@ -53,6 +53,20 @@
}
],
"rewrites": [
{
"source": "/:path(.*)",
"has": [{ "type": "host", "value": "(?<sub>.+)\\.aethex\\.me" }],
"destination": "/index.html"
},
{
"source": "/:path(.*)",
"has": [{ "type": "host", "value": "(?<sub>.+)\\.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" },