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

Skip to content

Commit a087ace

Browse files
committed
WIP
1 parent d32b7b7 commit a087ace

File tree

5 files changed

+8
-19
lines changed

5 files changed

+8
-19
lines changed

coderd/apidocs/docs.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ const docTemplate = `{
594594
// SwaggerInfo holds exported Swagger Info so clients can modify it
595595
var SwaggerInfo = &swag.Spec{
596596
Version: "2.0",
597-
Host: "",
597+
Host: "localhost:8080",
598598
BasePath: "/api/v2",
599599
Schemes: []string{},
600600
Title: "Coderd API",

coderd/apidocs/swagger.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"version": "2.0"
1717
},
18+
"host": "localhost:8080",
1819
"basePath": "/api/v2",
1920
"paths": {
2021
"/workspaces": {

coderd/coderd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@ type Options struct {
123123
// @license.name AGPL-3.0
124124
// @license.url https://github.com/coder/coder/blob/main/LICENSE
125125

126+
// @host localhost:8080
126127
// @BasePath /api/v2
127128

128129
// @securitydefinitions.apiKey CoderSessionToken

docs/api.md

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,3 @@
1-
---
2-
title: Coderd API v2.0
3-
language_tabs:
4-
- shell: curl
5-
language_clients:
6-
- shell: ""
7-
toc_footers: []
8-
includes: []
9-
search: false
10-
highlight_theme: darkula
11-
headingLevel: 2
12-
13-
---
14-
151
<!-- Generator: Widdershins v4.0.1 -->
162

173
<h1 id="coderd-api">Coderd API v2.0</h1>
@@ -22,7 +8,7 @@ Coderd is the service created by running coder server. It is a thin API that con
228

239
Base URLs:
2410

25-
* <a href="/api/v2">/api/v2</a>
11+
* <a href="//localhost:8080/api/v2">//localhost:8080/api/v2</a>
2612

2713
<a href="https://coder.com/legal/terms-of-service">Terms of service</a>
2814
Email: <a href="mailto:[email protected]">API Support</a> Web: <a href="http://coder.com">API Support</a>
@@ -43,7 +29,7 @@ License: <a href="https://github.com/coder/coder/blob/main/LICENSE">AGPL-3.0</a>
4329
4430
```shell
4531
# You can also use wget
46-
curl -X GET /api/v2/workspaces \
32+
curl -X GET /localhost:8080/api/v2/workspaces \
4733
-H 'Accept: application/json' \
4834
-H 'Coder-Session-Token: API_KEY'
4935

@@ -217,7 +203,7 @@ CoderSessionToken
217203
218204
```shell
219205
# You can also use wget
220-
curl -X GET /api/v2/workspaces/{id} \
206+
curl -X GET /localhost:8080/api/v2/workspaces/{id} \
221207
-H 'Accept: application/json' \
222208
-H 'Coder-Session-Token: API_KEY'
223209

scripts/apidocgen/generate.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ SCRIPT_DIR=$(dirname "${BASH_SOURCE[0]}")
2828
#
2929
node ./node_modules/widdershins/widdershins.js \
3030
--search false \
31-
--language_tabs 'shell:curl' \
31+
--omitHeader true \
32+
--language_tabs "shell:curl" \
3233
--summary "../../coderd/apidocs/swagger.json" \
3334
--outfile "../../docs/api.md"
3435
)

0 commit comments

Comments
 (0)