Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

use vercel.json instead

Steven Teye90971f26eec
diff --git a/middleware.ts b/middleware.ts
index 6aa535d2dc..111d35cf44 100644
--- a/middleware.ts
+++ b/middleware.ts
@@ -34,10 +34,6 @@ export default async function middleware(req: NextRequest, ev: NextFetchEvent) {
const { domain, path, fullPath, key } = parse(req);
if (isHomeHostname(domain)) {
- // for docs via Mintlify
- if (fullPath.startsWith("/docs")) {
- return NextResponse.rewrite(`https://dub.mintlify.dev/docs${fullPath}`);
- }
return NextResponse.rewrite(
new URL(`/dub.co${path === "/" ? "" : path}`, req.url),
);
diff --git a/vercel.json b/vercel.json
new file mode 100644
index 0000000000..ba5d1e5e7e
--- /dev/null
+++ b/vercel.json
@@ -0,0 +1,44 @@
+{
+ "rewrites": [
+ {
+ "source": "/docs",
+ "has": [
+ {
+ "type": "host",
+ "value": "dub.co"
+ }
+ ],
+ "destination": "https://dub.mintlify.dev/docs"
+ },
+ {
+ "source": "/docs/:path*",
+ "has": [
+ {
+ "type": "host",
+ "value": "dub.co"
+ }
+ ],
+ "destination": "https://dub.mintlify.dev/docs/:path*"
+ },
+ {
+ "source": "/docs",
+ "has": [
+ {
+ "type": "host",
+ "value": "dub-(?<branch>.*)-elegance.vercel.app"
+ }
+ ],
+ "destination": "https://dub.mintlify.dev/docs"
+ },
+ {
+ "source": "/docs/:path*",
+ "has": [
+ {
+ "type": "host",
+ "value": "dub-(?<branch>.*)-elegance.vercel.app"
+ }
+ ],
+ "destination": "https://dub.mintlify.dev/docs/:path*"
+ }
+ ]
+}