Browse Source

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

Skylsmoi 6 years ago
parent
commit
dc115b90de

+ 1 - 1
frontend/.gitignore View File

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

+ 0 - 1
frontend/configEnv.js.sample View File

1
-export const apiUrl = 'http://localhost:6543/api/v2'

+ 3 - 0
frontend/configEnv.json View File

1
+{
2
+  "apiUrl": "http://localhost:6543/api/v2"
3
+}

+ 3 - 0
frontend/configEnv.json.sample View File

1
+{
2
+  "apiUrl": "http://localhost:6543/api/v2"
3
+}

+ 2 - 2
frontend/src/helper.js View File

1
-import { apiUrl as configApiUrl } from '../configEnv.js'
1
+const configEnv = require('../configEnv.json')
2
 
2
 
3
 export const FETCH_CONFIG = {
3
 export const FETCH_CONFIG = {
4
   headers: {
4
   headers: {
5
     'Accept': 'application/json',
5
     'Accept': 'application/json',
6
     'Content-Type': 'application/json'
6
     'Content-Type': 'application/json'
7
   },
7
   },
8
-  apiUrl: configApiUrl,
8
+  apiUrl: configEnv.apiUrl,
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)
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