The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update middleware.ts
Steven Tey2b9339c4ad5f
diff --git a/middleware.ts b/middleware.tsindex 09af71c61a..2f793c6efc 100644--- a/middleware.ts+++ b/middleware.ts@@ -31,14 +31,22 @@ export default async function middleware(req: NextRequest, ev: NextFetchEvent) {const { domain, path, key } = parse(req);const home = domain === "dub.sh";+ // for App (app.dub.sh and app.localhost:3000)if (domain === "app.dub.sh" || domain === "app.localhost:3000") {return AppMiddleware(req);}+ // for API (api.dub.sh and api.localhost:3000)if (domain === "api.dub.sh" || domain === "api.localhost:3000") {return ApiMiddleware(req);}+ // for public stats pages (e.g. dub.sh/stats/github)+ if (path.startsWith("/stats/")) {+ return NextResponse.next();+ }++ // for Root pages (e.g. dub.sh, vercel.fyi, etc.)if (key.length === 0) {return RootMiddleware(req, ev);}