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 api.dub.co for openapi spec

Steven Tey8ed8fc6c7713
diff --git a/apps/docs/mint.json b/apps/docs/mint.json
index 9f5a77ec65..0ca4007e52 100644
--- a/apps/docs/mint.json
+++ b/apps/docs/mint.json
@@ -29,7 +29,7 @@
"name": "Dashboard",
"url": "https://app.dub.co"
},
- "openapi": "https://api.dub.sh",
+ "openapi": "https://api.dub.co",
"tabs": [
{
"name": "API Reference",
diff --git a/apps/web/app/api/route.ts b/apps/web/app/api/route.ts
index e9bb9568e7..f96dd31c8d 100644
--- a/apps/web/app/api/route.ts
+++ b/apps/web/app/api/route.ts
@@ -14,7 +14,7 @@ export function GET(): NextResponse<OpenAPIV3.Document> {
contact: {
name: "Dub.co Support",
- url: "https://dub.co/help",
+ url: "https://dub.co/api",
},
version: "0.0.1",
},
diff --git a/apps/web/lib/middleware/api.ts b/apps/web/lib/middleware/api.ts
index c8ddb4ede0..0988aaddfd 100644
--- a/apps/web/lib/middleware/api.ts
+++ b/apps/web/lib/middleware/api.ts
@@ -3,17 +3,10 @@ import { HOME_DOMAIN } from "@dub/utils";
import { NextRequest, NextResponse } from "next/server";
export default function ApiMiddleware(req: NextRequest) {
- const { path, fullPath, domain } = parse(req);
- if (fullPath === "/" && domain === "api.dub.co") {
- return NextResponse.redirect(
- `${HOME_DOMAIN}/docs/api-reference/introduction`,
- {
- status: 307,
- },
- );
+ const { path, fullPath } = parse(req);
- // special case for /metatags
- } else if (path === "/metatags") {
+ // special case for /metatags
+ if (path === "/metatags") {
const url = req.nextUrl.searchParams.get("url");
if (!url) {
return NextResponse.redirect(`${HOME_DOMAIN}/tools/metatags`, {