Skip to content

Commit 9813659

Browse files
committed
refactor(api): simplify routing
1 parent 5f5bd30 commit 9813659

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed

.github/workflows/sync.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
--blacklist=blacklist.json \
3434
--resource-dir=build/resources \
3535
build/feeds \
36-
public/docsets.json
36+
public/_api/v1/docsets.json
3737
3838
- name: Deploy to Vercel
3939
run: |

.gitignore

+3-3
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ node_modules/
116116
.next/
117117
next-env.d.ts
118118

119-
# Generated files
120-
public/docsets.json
121-
122119
# Vercel
123120
.vercel/
121+
122+
# Generated files
123+
public/_api/v1/docsets.json

next.config.js

+8-6
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,14 @@ const nextConfig = {
1515
beforeFiles: [
1616
// api.zealdocs.org
1717
{
18-
source: "/v1/docsets",
19-
destination: "/docsets.json",
20-
},
21-
{
22-
source: "/v1/releases",
23-
destination: "/releases.json",
18+
source: "/v1/:file(releases|docsets)",
19+
destination: "/_api/v1/:file.json",
20+
has: [
21+
{
22+
type: "host",
23+
value: "api.zealdocs.org",
24+
},
25+
],
2426
},
2527
// go.zealdocs.org
2628
{
File renamed without changes.

0 commit comments

Comments
 (0)