Bachir Soussi Chiadmi 3 years ago
parent
commit
918a6c602e
2 changed files with 3 additions and 2 deletions
  1. 1 1
      src/api/rest-axios.js
  2. 2 1
      src/index.js

+ 1 - 1
src/api/rest-axios.js

@@ -16,7 +16,7 @@ import axios from 'axios'
 // let path = 'http://' + window.location.hostname + (window.env === 'prod' ? '/api' : ':8984')
 
 export const REST = axios.create({
-  baseURL: 'http://' + window.location.hostname,
+  // baseURL: 'http://',
   // withCredentials: true,
   crossorigin: true,
   headers: {

+ 2 - 1
src/index.js

@@ -31,7 +31,8 @@ Vue.use(InfiniteLoading, {
 Vue.use(VueScrollTo)
 
 // window.env = process.env
-window.apipath = process.env === 'prod' ? '/api' : ':8984'
+
+window.apipath = process.env === 'prod' ? `http://${window.location.hostname}/api` : 'http://localhost:8984'
 
 // sync(store, router) // done. Returns an unsync callback fn