import { NextResponse } from "next/server";
import type { NextRequest } from "next/server";

export function middleware(request: NextRequest) {
  const hostname = request.headers.get("host") || "";

  // Redirect dandylion.nusqool.com root to /embodiment-circle
  if (hostname.includes("dandylion.nusqool.com") && request.nextUrl.pathname === "/") {
    return NextResponse.redirect(new URL("/embodiment-circle", request.url));
  }

  return NextResponse.next();
}

export const config = {
  matcher: ["/"],
};
