The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
import { SHORT_DOMAIN } from "@dub/utils";
import { MetadataRoute } from "next";
import { headers } from "next/headers";
export default async function sitemap(): Promise<MetadataRoute.Sitemap> {
const headersList = await headers();
let domain = headersList.get("host") as string;
if (domain === "dub.localhost:8888") {
// for local development and preview URLs
domain = SHORT_DOMAIN;
}
return [
{
url: `https://${domain}`,
lastModified: new Date(),
},
];
}