mirror of
https://github.com/Unleash/unleash.git
synced 2024-12-22 19:07:54 +01:00
fix urls
This commit is contained in:
parent
3b53b79fb2
commit
8070e6000e
@ -31,8 +31,7 @@
|
||||
"lint": "eslint . --ext=js,jsx",
|
||||
"test": "echo 'no test'",
|
||||
"test:ci": "npm run test",
|
||||
"prepublish": "npm run build",
|
||||
"postinstall": "npm run build"
|
||||
"prepublish": "npm run build"
|
||||
},
|
||||
"main": "./index.js",
|
||||
"dependencies": {
|
||||
|
@ -1,5 +1,7 @@
|
||||
const defaultErrorMessage = 'Unexptected exception when talking to unleash-api';
|
||||
|
||||
const URI = '/api/metrics/features';
|
||||
|
||||
function throwIfNotSuccess (response) {
|
||||
if (!response.ok) {
|
||||
if (response.status > 400 && response.status < 404) {
|
||||
@ -19,7 +21,7 @@ function throwIfNotSuccess (response) {
|
||||
}
|
||||
|
||||
function fetchFeatureMetrics () {
|
||||
return fetch('/metrics/features')
|
||||
return fetch(URI)
|
||||
.then(throwIfNotSuccess)
|
||||
.then(response => response.json());
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user