Sitelet https://github.com/krishnatray/koding/commit/7095209587e5c2c22c7f80a234b0bfaa634b2653
Skip to content

Commit 7095209

Browse files
committed
Swagger: set default host as koding.com, in apidocs use document.host
1 parent 90ff0da commit 7095209

3 files changed

Lines changed: 6 additions & 12 deletions

File tree

‎scripts/api-generator.coffee‎

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ docGen = require './docgen'
1212
swagger =
1313
swagger: '2.0'
1414
basePath: '/remote.api'
15-
15+
host: 'koding.com'
1616
info:
1717
title: 'Koding API'
1818
version: '0.0.3'
@@ -34,11 +34,6 @@ swagger =
3434
}
3535
]
3636

37-
schemes: [
38-
'http'
39-
'https'
40-
]
41-
4237
definitions:
4338
Error:
4439
type: 'object'
@@ -102,7 +97,7 @@ swagger =
10297
description: 'body of the request'
10398

10499
paths:
105-
'/-/version':
100+
'../-/version':
106101
get:
107102
tags: [ 'system' ]
108103
responses:

‎website/apidocs/index.html‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,8 @@
7272
$("#resources > li > ul.endpoints").show();
7373
});
7474

75+
swaggerUi.api.setHost(document.location.host);
76+
7577
}
7678
});
7779

‎website/swagger.json‎

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"swagger": "2.0",
33
"basePath": "/remote.api",
4+
"host": "koding.com",
45
"info": {
56
"title": "Koding API",
67
"version": "0.0.3",
@@ -215,10 +216,6 @@
215216
"name": "JVerificationToken"
216217
}
217218
],
218-
"schemes": [
219-
"http",
220-
"https"
221-
],
222219
"definitions": {
223220
"Error": {
224221
"type": "object",
@@ -1510,7 +1507,7 @@
15101507
}
15111508
},
15121509
"paths": {
1513-
"/-/version": {
1510+
"../-/version": {
15141511
"get": {
15151512
"tags": [
15161513
"system"

0 commit comments

Comments
 (0)