The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Rename stats to analytics
Steven Tey5706e19dd746
diff --git a/apps/web/app/api/stats/[endpoint]/route.ts b/apps/web/app/api/analytics/[endpoint]/route.tssimilarity index 92%rename from apps/web/app/api/stats/[endpoint]/route.tsrename to apps/web/app/api/analytics/[endpoint]/route.tsindex 901a327137..9d796fe286 100644--- a/apps/web/app/api/stats/[endpoint]/route.ts+++ b/apps/web/app/api/analytics/[endpoint]/route.ts@@ -2,7 +2,7 @@ import { withAuth } from "@/lib/auth";import { getStats } from "@/lib/stats";import { NextResponse } from "next/server";-// GET /api/stats/[endpoint] – get stats for a specific endpoint+// GET /api/analytics/[endpoint] – get stats for a specific endpointexport const GET = withAuth(async ({ params, searchParams, project }) => {const { endpoint } = params;diff --git a/apps/web/app/api/edge/stats/[endpoint]/route.ts b/apps/web/app/api/analytics/edge/[endpoint]/route.tssimilarity index 100%rename from apps/web/app/api/edge/stats/[endpoint]/route.tsrename to apps/web/app/api/analytics/edge/[endpoint]/route.tsdiff --git a/apps/web/app/api/stats/route.ts b/apps/web/app/api/analytics/route.tssimilarity index 100%rename from apps/web/app/api/stats/route.tsrename to apps/web/app/api/analytics/route.tsdiff --git a/apps/web/app/api/projects/[slug]/stats/[endpoint]/route.ts b/apps/web/app/api/projects/[slug]/stats/[endpoint]/route.tsindex 33265a2e2a..e49d9e17af 100644--- a/apps/web/app/api/projects/[slug]/stats/[endpoint]/route.ts+++ b/apps/web/app/api/projects/[slug]/stats/[endpoint]/route.ts@@ -1 +1 @@-export * from "../../../../stats/[endpoint]/route";+export * from "../../../../analytics/[endpoint]/route";diff --git a/apps/web/app/api/projects/[slug]/stats/route.ts b/apps/web/app/api/projects/[slug]/stats/route.tsindex 453e76454c..bbf49fabdf 100644--- a/apps/web/app/api/projects/[slug]/stats/route.ts+++ b/apps/web/app/api/projects/[slug]/stats/route.ts@@ -1 +1 @@-export * from "../../../stats/route";+export * from "../../../analytics/route";diff --git a/apps/web/ui/domains/domain-card.tsx b/apps/web/ui/domains/domain-card.tsxindex 187bcd2161..a358ba0ef4 100644--- a/apps/web/ui/domains/domain-card.tsx+++ b/apps/web/ui/domains/domain-card.tsx@@ -44,7 +44,7 @@ export default function DomainCard({ props }: { props: DomainProps }) {);const { data: clicks } = useSWR<number>(- slug && `/api/projects/${slug}/stats/clicks?domain=${domain}&key=_root`,+ slug && `/api/projects/${slug}/analytics/clicks?domain=${domain}&key=_root`,fetcher,{fallbackData: props.clicks,diff --git a/apps/web/ui/stats/index.tsx b/apps/web/ui/stats/index.tsxindex 34238d30ee..5e2b55879e 100644--- a/apps/web/ui/stats/index.tsx+++ b/apps/web/ui/stats/index.tsx@@ -85,7 +85,7 @@ export default function Stats({// Public stats page, e.g. dub.co/stats/github, stey.me/stats/weathergptreturn {basePath: `/stats/${key}`,- baseApiPath: `/api/edge/stats`,+ baseApiPath: `/api/analytics/edge`,domain: staticDomain,};}, [slug, pathname, staticDomain, domainSlug, key]);