diff options
author | 2019-10-18 20:53:41 +0200 | |
---|---|---|
committer | 2019-10-18 20:53:41 +0200 | |
commit | af506f40edb1c9c339cc86baf40baccf2dc6da62 (patch) | |
tree | d5efae2f9374ee11d645096208424d59812a9a58 /src/api | |
parent | Merge branch 'develop' into local-server (diff) | |
download | ferdium-app-af506f40edb1c9c339cc86baf40baccf2dc6da62.tar.gz ferdium-app-af506f40edb1c9c339cc86baf40baccf2dc6da62.tar.zst ferdium-app-af506f40edb1c9c339cc86baf40baccf2dc6da62.zip |
Develop local server feature
Diffstat (limited to 'src/api')
-rw-r--r-- | src/api/apiBase.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/api/apiBase.js b/src/api/apiBase.js index e8d571171..561b025f0 100644 --- a/src/api/apiBase.js +++ b/src/api/apiBase.js | |||
@@ -4,6 +4,9 @@ | |||
4 | import { | 4 | import { |
5 | API_VERSION, | 5 | API_VERSION, |
6 | } from '../environment'; | 6 | } from '../environment'; |
7 | import { | ||
8 | LOCAL_SERVER, | ||
9 | } from '../config'; | ||
7 | 10 | ||
8 | const apiBase = () => { | 11 | const apiBase = () => { |
9 | let url; | 12 | let url; |
@@ -21,6 +24,9 @@ const apiBase = () => { | |||
21 | // on some routes. This would result in Ferdi deleting its current authToken as it thinks it | 24 | // on some routes. This would result in Ferdi deleting its current authToken as it thinks it |
22 | // has gone invalid. | 25 | // has gone invalid. |
23 | url = 'https://1.1.1.1'; | 26 | url = 'https://1.1.1.1'; |
27 | } else if (window.ferdi.stores.settings.all.app.server === LOCAL_SERVER) { | ||
28 | // Use URL for local server | ||
29 | url = `http://127.0.0.1:${window.ferdi.stores.requests.localServerPort}`; | ||
24 | } else { | 30 | } else { |
25 | // Load URL from store | 31 | // Load URL from store |
26 | url = window.ferdi.stores.settings.all.app.server; | 32 | url = window.ferdi.stores.settings.all.app.server; |