Skip to content

Commit 68c07ae

Browse files
committed
[BLD-259] Playground, Portal: Add revalidation for API Reference page
1 parent 62f9fc4 commit 68c07ae

File tree

2 files changed

+24
-14
lines changed

2 files changed

+24
-14
lines changed
Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,15 @@
1-
import { ScalarApiReference } from "../../components/blocks/scalar-api/ScalarClient";
1+
import { ScalarApiReference } from "@/components/blocks/scalar-api/ScalarClient";
2+
import { createMetadata } from "@/lib/metadata";
23

34
export default async function ReferencePage() {
45
const responses = await fetch("https://api.thirdweb.com/openapi.json");
56
const spec = await responses.json();
67
return <ScalarApiReference spec={spec} />;
78
}
9+
10+
export const metadata = createMetadata({
11+
title: "thirdwebAPI Reference",
12+
description: "A Unified interface for Web3 development",
13+
});
14+
15+
export const revalidate = 3600;

apps/portal/src/app/reference/page.tsx

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,22 @@ import { createMetadata } from "@/components/Document";
22
import { ScalarApiReference } from "./ScalarClient";
33

44
export const metadata = createMetadata({
5-
image: {
6-
title: "API Reference",
7-
icon: "thirdweb",
8-
},
9-
title: "thirdweb API Reference",
10-
description: "Complete REST API reference for all thirdweb services",
5+
image: {
6+
title: "thirdweb API Reference",
7+
icon: "thirdweb",
8+
},
9+
title: "thirdweb API Reference",
10+
description: "A Unified interface for Web3 development",
1111
});
1212

1313
export default async function ApiReferencePage() {
14-
const responses = await fetch("https://api.thirdweb.com/openapi.json");
15-
const spec = await responses.json();
16-
return (
17-
<div className="container max-sm:px-0">
18-
<ScalarApiReference spec={spec} />
19-
</div>
20-
);
14+
const responses = await fetch("https://api.thirdweb.com/openapi.json");
15+
const spec = await responses.json();
16+
return (
17+
<div className="container max-sm:px-0">
18+
<ScalarApiReference spec={spec} />
19+
</div>
20+
);
2121
}
22+
23+
export const revalidate = 3600;

0 commit comments

Comments
 (0)