From 8070e6000e0b24e2379595559fe6e304fe44b274 Mon Sep 17 00:00:00 2001 From: ivaosthu Date: Thu, 10 Nov 2016 16:34:39 +0100 Subject: [PATCH] fix urls --- frontend/package.json | 3 +-- frontend/src/store/feature-metrics-api.js | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) 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()); }