Przeglądaj źródła

[https://github.com/tracim/tracim/issues/825] config is now a json file instead of js file

Skylsmoi 6 lat temu
rodzic
commit
dc115b90de

+ 1 - 1
frontend/.gitignore Wyświetl plik

@@ -4,4 +4,4 @@ node_modules/
4 4
 dist/asset/tracim.app.entry.js
5 5
 dist/asset/tracim.vendor.bundle.js
6 6
 dist/asset/images/
7
-configEnv.js
7
+configEnv.json

+ 0 - 1
frontend/configEnv.js.sample Wyświetl plik

@@ -1 +0,0 @@
1
-export const apiUrl = 'http://localhost:6543/api/v2'

+ 3 - 0
frontend/configEnv.json Wyświetl plik

@@ -0,0 +1,3 @@
1
+{
2
+  "apiUrl": "http://localhost:6543/api/v2"
3
+}

+ 3 - 0
frontend/configEnv.json.sample Wyświetl plik

@@ -0,0 +1,3 @@
1
+{
2
+  "apiUrl": "http://localhost:6543/api/v2"
3
+}

+ 2 - 2
frontend/src/helper.js Wyświetl plik

@@ -1,11 +1,11 @@
1
-import { apiUrl as configApiUrl } from '../configEnv.js'
1
+const configEnv = require('../configEnv.json')
2 2
 
3 3
 export const FETCH_CONFIG = {
4 4
   headers: {
5 5
     'Accept': 'application/json',
6 6
     'Content-Type': 'application/json'
7 7
   },
8
-  apiUrl: configApiUrl,
8
+  apiUrl: configEnv.apiUrl,
9 9
   mockApiUrl: 'http://localhost:3001' // @todo: better to use one url only and use proxy on mock api to point to real api (if implemented)
10 10
 }
11 11