Skip to content

Commit 01b00b6

Browse files
authored
feat: change site.json api route (#8718)
1 parent 62a66aa commit 01b00b6

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
1-
import { NextResponse } from 'next/server';
2-
31
import { siteConfig } from '#site/next.json.mjs';
42

53
export const GET = () =>
6-
NextResponse.json(siteConfig, {
4+
Response.json(siteConfig, {
75
headers: {
86
'Cache-Control': 'public, max-age=300, stale-while-revalidate=3600',
97
},

docs/site-config.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
`apps/site/site.json` is a manually maintained JSON file that controls global site metadata, RSS feeds, and time-sensitive UI elements (banners and badges).
44

5-
It is imported via `apps/site/next.json.mjs` and exposed as a read-only API endpoint at `/api/site.json`.
5+
It is imported via `apps/site/next.json.mjs` and exposed as a read-only API endpoint at `/site.json`.
66

77
This endpoint is also consumed externally by the [doc-kit](https://github.com/nodejs/doc-kit) to display dynamic banners inside the API docs, for example security announcements or EOL notices, without requiring a doc-kit release.
88

@@ -117,7 +117,7 @@ A map of page slugs to badge definitions. Badges appear as small promotional lab
117117
The full contents of `site.json` are available at:
118118

119119
```
120-
GET /api/site.json
120+
GET /site.json
121121
```
122122

123123
The response is `application/json` and is statically cached at build time. It refreshes on each deployment.

0 commit comments

Comments
 (0)