Skip to content
This repository was archived by the owner on May 7, 2024. It is now read-only.

Commit a5548db

Browse files
committed
Relative paths when calling backend
1 parent 544b287 commit a5548db

File tree

5 files changed

+166
-166
lines changed

5 files changed

+166
-166
lines changed

assets/js/app/consumers/consumer-service.js

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424

2525
query : function(query) {
2626
return $http({
27-
url : BackendConfig.url + '/kong/consumers',
27+
url : 'kong/consumers',
2828
method: "GET",
2929
params : query
3030
})
3131
},
3232

3333
findById : function(id) {
3434
return $http({
35-
url : BackendConfig.url + '/kong/consumers/' + id,
35+
url : 'kong/consumers/' + id,
3636
method: "GET"
3737
})
3838
},
@@ -42,43 +42,43 @@
4242
},
4343

4444
create : function(consumer) {
45-
return $http.post(BackendConfig.url + '/kong/consumers',clean(consumer))
45+
return $http.post('kong/consumers',clean(consumer))
4646
},
4747

4848
update : function(id,data) {
49-
return $http.patch(BackendConfig.url + '/kong/consumers/' + id,data)
49+
return $http.patch('kong/consumers/' + id,data)
5050
},
5151

5252
delete : function(consumer) {
53-
return $http.delete(BackendConfig.url + '/kong/consumers/' + consumer.id)
53+
return $http.delete('kong/consumers/' + consumer.id)
5454
},
5555

5656
fetchAcls : function(consumerId) {
57-
return $http.get(BackendConfig.url + '/kong/consumers/' + consumerId + '/acls')
57+
return $http.get('kong/consumers/' + consumerId + '/acls')
5858
},
5959

6060
addAcl : function(consumerId,data) {
61-
return $http.post(BackendConfig.url + '/kong/consumers/' + consumerId + '/acls',data)
61+
return $http.post('kong/consumers/' + consumerId + '/acls',data)
6262
},
6363

6464
deleteAcl : function(consumerId,groupId) {
65-
return $http.delete(BackendConfig.url + '/kong/consumers/' + consumerId + '/acls/' + groupId)
65+
return $http.delete('kong/consumers/' + consumerId + '/acls/' + groupId)
6666
},
6767

6868
addCredential : function(consumerId,credential,data) {
69-
return $http.post(BackendConfig.url + '/kong/consumers/' + consumerId + '/' + credential,data)
69+
return $http.post('kong/consumers/' + consumerId + '/' + credential,data)
7070
},
7171

7272
loadCredentials : function(consumerId,credential) {
73-
return $http.get(BackendConfig.url + '/kong/consumers/' + consumerId + '/' + credential)
73+
return $http.get('kong/consumers/' + consumerId + '/' + credential)
7474
},
7575

7676
listCredentials : function(consumerId) {
77-
return $http.get(BackendConfig.url + '/kong/consumers/' + consumerId + '/credentials')
77+
return $http.get('kong/consumers/' + consumerId + '/credentials')
7878
},
7979

8080
removeCredential : function(consumerId,credential,credential_id) {
81-
return $http.delete(BackendConfig.url + '/kong/consumers/' + consumerId + '/' + credential + '/' + credential_id)
81+
return $http.delete('kong/consumers/' + consumerId + '/' + credential + '/' + credential_id)
8282
},
8383
}
8484
}

assets/js/app/info/02_info-service.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
return {
1515

1616
getInfo : function() {
17-
return $http.get(BackendConfig.url + '/kong/info')
17+
return $http.get('kong/info')
1818
},
1919
nodeStatus : function() {
20-
return $http.get(BackendConfig.url + '/kong/status')
20+
return $http.get('kong/status')
2121
},
2222

2323
clusterStatus : function() {
24-
return $http.get(BackendConfig.url + '/kong/cluster')
24+
return $http.get('kong/cluster')
2525
},
2626
}
2727
}

assets/js/app/plugins/plugin-helper-service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
files.push(data['config.key'])
6565

6666
Upload.upload({
67-
url: BackendConfig.url + '/kong/plugins',
67+
url: 'kong/plugins',
6868
arrayKey: '',
6969
data: {
7070
file: files,

assets/js/app/plugins/plugins-service.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,33 +14,33 @@
1414
return {
1515

1616
load : function(query) {
17-
return $http.get(BackendConfig.url + '/kong/plugins',{
17+
return $http.get('kong/plugins',{
1818
params: query
1919
})
2020
},
2121

2222
add : function(data) {
23-
return $http.post(BackendConfig.url + '/kong/plugins',data)
23+
return $http.post('kong/plugins',data)
2424
},
2525

2626
update : function(id,data) {
27-
return $http.patch(BackendConfig.url + '/kong/plugins/' + id,data)
27+
return $http.patch('kong/plugins/' + id,data)
2828
},
2929

3030
fetch : function(pluginId) {
31-
return $http.get(BackendConfig.url + '/kong/plugins/' + pluginId)
31+
return $http.get('kong/plugins/' + pluginId)
3232
},
3333

3434
schema : function(name) {
35-
return $http.get(BackendConfig.url + '/kong/plugins/schema/' + name)
35+
return $http.get('kong/plugins/schema/' + name)
3636
},
3737

3838
enabled : function() {
39-
return $http.get(BackendConfig.url + '/kong/plugins/enabled');
39+
return $http.get('kong/plugins/enabled');
4040
},
4141

4242
delete : function(id) {
43-
return $http.delete(BackendConfig.url + '/kong/plugins/' + id)
43+
return $http.delete('kong/plugins/' + id)
4444
}
4545
}
4646
}

0 commit comments

Comments
 (0)