From 827e4ff982a66340c18f09117e1daa1dfe9e0f99 Mon Sep 17 00:00:00 2001
From: Eliot Berriot <contact@eliotberriot.com>
Date: Sun, 18 Feb 2018 14:29:59 +0100
Subject: [PATCH] Removed now useless BACKEND_URL setting

---
 .env.dev                 | 1 -
 front/config/prod.env.js | 2 +-
 front/src/config.js      | 6 ------
 3 files changed, 1 insertion(+), 8 deletions(-)

diff --git a/.env.dev b/.env.dev
index e27084a6..d42cdad0 100644
--- a/.env.dev
+++ b/.env.dev
@@ -1,4 +1,3 @@
-BACKEND_URL=http://localhost:6001
 API_AUTHENTICATION_REQUIRED=True
 CACHALOT_ENABLED=False
 RAVEN_ENABLED=false
diff --git a/front/config/prod.env.js b/front/config/prod.env.js
index fe0e80b8..decfe361 100644
--- a/front/config/prod.env.js
+++ b/front/config/prod.env.js
@@ -1,4 +1,4 @@
 module.exports = {
   NODE_ENV: '"production"',
-  BACKEND_URL: '"' + (process.env.BACKEND_URL  || '/') + '"'
+  BACKEND_URL: '"/"'
 }
diff --git a/front/src/config.js b/front/src/config.js
index b0ceb789..47d9d7b8 100644
--- a/front/src/config.js
+++ b/front/src/config.js
@@ -1,12 +1,6 @@
 class Config {
   constructor () {
     this.BACKEND_URL = process.env.BACKEND_URL
-    if (this.BACKEND_URL === '/') {
-      this.BACKEND_URL = window.location.protocol + '//' + window.location.hostname + ':' + window.location.port
-    }
-    if (this.BACKEND_URL.slice(-1) !== '/') {
-      this.BACKEND_URL += '/'
-    }
     this.API_URL = this.BACKEND_URL + 'api/v1/'
   }
 }
-- 
GitLab