Bladeren bron

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

Skylsmoi 6 jaren geleden
bovenliggende
commit
dc115b90de
5 gewijzigde bestanden met toevoegingen van 9 en 4 verwijderingen
  1. 1 1
      frontend/.gitignore
  2. 0 1
      frontend/configEnv.js.sample
  3. 3 0
      frontend/configEnv.json
  4. 3 0
      frontend/configEnv.json.sample
  5. 2 2
      frontend/src/helper.js

+ 1 - 1
frontend/.gitignore Bestand weergeven

@@ -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 Bestand weergeven

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

+ 3 - 0
frontend/configEnv.json Bestand weergeven

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

+ 3 - 0
frontend/configEnv.json.sample Bestand weergeven

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

+ 2 - 2
frontend/src/helper.js Bestand weergeven

@@ -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