aboutsummaryrefslogtreecommitdiffstats
path: root/graphgraph-fe
diff options
context:
space:
mode:
authorPavel Paroulek <pavel.paroulek@orange.com>2019-09-05 15:39:22 +0200
committerPavel Paroulek <pavel.paroulek@orange.com>2019-09-05 15:54:11 +0200
commit38836a11b672b9743cd4b16298dad8d5febfe636 (patch)
tree77f177b891646aaba52d97b1425d44d883a2ae15 /graphgraph-fe
parente9f43d63da7f1f5bf2f96e7d1d0b6c1b877e60b6 (diff)
Flexible port and protocol for requests
Change-Id: Ie132683d768fe83b4262f5dac640dbff9137e1c0 Signed-off-by: Pavel Paroulek <pavel.paroulek@orange.com> Issue-ID: AAI-532
Diffstat (limited to 'graphgraph-fe')
-rw-r--r--graphgraph-fe/src/requests.js17
1 files changed, 9 insertions, 8 deletions
diff --git a/graphgraph-fe/src/requests.js b/graphgraph-fe/src/requests.js
index 2494ba1..cb23bd7 100644
--- a/graphgraph-fe/src/requests.js
+++ b/graphgraph-fe/src/requests.js
@@ -1,30 +1,31 @@
const host = window.location.hostname;
-const port = 8453;
+const port = window.location.port;
+const protocol = window.location.protocol;
export function schemas () {
- return `http://${host}:${port}/schemas`
+ return `${protocol}//${host}:${port}/schemas`
}
export function validateSchema (schema) {
- return `http://${host}:${port}/schemas/${schema}/validation`
+ return `${protocol}//${host}:${port}/schemas/${schema}/validation`
}
export function nodeNames (schema, edgeFilter) {
- return `http://${host}:${port}/schemas/${schema}/nodes?edgeFilter=${edgeFilter}`
+ return `${protocol}//${host}:${port}/schemas/${schema}/nodes?edgeFilter=${edgeFilter}`
}
export function basicGraph (schema, node, parentHops, cousinHops, childHops, edgeFilter) {
- return `http://${host}:${port}/schemas/${schema}/graph/basic?node=${node}&parentHops=${parentHops}&cousinHops=${cousinHops}&childHops=${childHops}&edgeFilter=${edgeFilter}`
+ return `${protocol}//${host}:${port}/schemas/${schema}/graph/basic?node=${node}&parentHops=${parentHops}&cousinHops=${cousinHops}&childHops=${childHops}&edgeFilter=${edgeFilter}`
}
export function pathGraph (schema, fromNode, toNode, edgeFilter) {
- return `http://${host}:${port}/schemas/${schema}/graph/paths?fromNode=${fromNode}&toNode=${toNode}&edgeFilter=${edgeFilter}`
+ return `${protocol}//${host}:${port}/schemas/${schema}/graph/paths?fromNode=${fromNode}&toNode=${toNode}&edgeFilter=${edgeFilter}`
}
export function nodeProperty (schema, node) {
- return `http://${host}:${port}/schemas/${schema}/nodes/${node}`
+ return `${protocol}//${host}:${port}/schemas/${schema}/nodes/${node}`
}
export function edgeProperty (schema, fromNode, toNode) {
- return `http://${host}:${port}/schemas/${schema}/edges?fromNode=${fromNode}&toNode=${toNode}`
+ return `${protocol}//${host}:${port}/schemas/${schema}/edges?fromNode=${fromNode}&toNode=${toNode}`
}