diff --git a/frontend/package.json b/frontend/package.json index b8f282b888..ee5c0a9735 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -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": { diff --git a/frontend/src/store/feature-metrics-api.js b/frontend/src/store/feature-metrics-api.js index cc4d28cac1..2368b952fe 100644 --- a/frontend/src/store/feature-metrics-api.js +++ b/frontend/src/store/feature-metrics-api.js @@ -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()); }