Browse Source

fixed https for prod api

bach 1 year ago
parent
commit
86d7cf8a10
1 changed files with 8 additions and 1 deletions
  1. 8 1
      src/index.js

+ 8 - 1
src/index.js

@@ -42,7 +42,14 @@ Vue.use(VueClipboard)
 Vue.use(VueSweetalert2)
 
 // https://apple.stackexchange.com/questions/17077/add-a-hosts-file-entry-without-jailbreaking
-window.apipath = process.env === 'prod' || window.location.hostname === 'dev.gdp.fr' ? `http://${window.location.hostname}/api` : 'http://localhost:8984'
+// window.apipath = process.env === 'prod' || window.location.hostname === 'dev.gdp.fr' ? `http://${window.location.hostname}/api` : 'http://localhost:8984'
+if (process.env === 'prod') {
+  window.apipath = `https://api.guidesdeparis.fr`
+} else if (window.location.hostname === 'dev.gdp.fr') {
+  window.apipath = `http://${window.location.hostname}/api`
+} else {
+  window.apipath = 'http://localhost:8984'
+}
 // if (window.location.hostname === 'dev.gdp.fr') {
 //   window.apipath = `http://${window.location.hostname}/api`
 // }