Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit de2ecc5

Browse files
committed
Switch to env var for spec url
1 parent d52eda3 commit de2ecc5

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

content/tutorials/contribute-api.markdown

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,12 +127,21 @@ npm install -g http-server
127127
128128
# Start it in the "dist/" folder
129129
# The "--cors" part at the end allows the website on port 1313 to reach the spec on the different port 8080.
130-
http-server dist/ --cors
130+
http-server dist/ --cors
131131
```
132132

133-
Your version of the specification is now available at `http://localhost:8080/openapi.yaml`. Switch VSCode window to the website project and modify the `spec-url` URL at the top of the `layouts/docs/single.html` file to point to this file instead.
133+
Your version of the specification is now available at `http://localhost:8080/openapi.yaml`. Switch VSCode window to the website project and restart the hugo server with the following command:
134134

135-
(Note: The API Docs will not automatically reload if you re-bundle the API spec.)
135+
```bash
136+
# Windows cmd.exe
137+
set SPEC_URL=http://localhost:8080/openapi.yaml
138+
./hugo.exe server
139+
140+
# Linux or Git Bash
141+
SPEC_URL=http://localhost:8080/openapi.yaml ./hugo server
142+
```
143+
144+
(Note: The API Docs will **not** automatically reload if you re-bundle the API spec.)
136145

137146
![](/assets/img/tutorials/contribute-api/result.png)
138147

layouts/docs/single.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<rapi-doc
55
id="rapi-doc"
6-
spec-url="https://vrchatapi.github.io/specification/openapi.yaml"
6+
spec-url={{ getenv "SPEC_URL" | default "https://vrchatapi.github.io/specification/openapi.yaml" }}
77
sort-endpoints-by = "none"
88

99
theme = "light"

0 commit comments

Comments
 (0)