diff options
author | 2019-07-18 15:53:09 +0200 | |
---|---|---|
committer | 2019-07-18 15:53:09 +0200 | |
commit | 2cc2042043c0dc4c3d60ecb35a9a08b57653c908 (patch) | |
tree | 70fa269ba33f604b98ad2dafa2b2ae928b386f0e | |
parent | basic integration of todos as static sidebar (diff) | |
download | ferdium-app-2cc2042043c0dc4c3d60ecb35a9a08b57653c908.tar.gz ferdium-app-2cc2042043c0dc4c3d60ecb35a9a08b57653c908.tar.zst ferdium-app-2cc2042043c0dc4c3d60ecb35a9a08b57653c908.zip |
Add production and dev urls for todos frontend
-rw-r--r-- | src/config.js | 4 | ||||
-rw-r--r-- | src/environment.js | 8 | ||||
-rw-r--r-- | src/features/todos/components/TodosWebview.js | 3 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/config.js b/src/config.js index 5bc318545..6968f8500 100644 --- a/src/config.js +++ b/src/config.js | |||
@@ -24,6 +24,10 @@ export const LIVE_API_WEBSITE = 'https://meetfranz.com'; | |||
24 | 24 | ||
25 | export const STATS_API = 'https://stats.franzinfra.com'; | 25 | export const STATS_API = 'https://stats.franzinfra.com'; |
26 | 26 | ||
27 | export const LOCAL_TODOS_FRONTEND_URL = 'http://localhost:4000'; | ||
28 | export const PRODUCTION_TODOS_FRONTEND_URL = 'https://franz-todos.netlify.com'; | ||
29 | export const DEVELOPMENT_TODOS_FRONTEND_URL = 'https://development--franz-todos.netlify.com'; | ||
30 | |||
27 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; | 31 | export const GA_ID = !isDevMode ? 'UA-74126766-10' : 'UA-74126766-12'; |
28 | 32 | ||
29 | export const DEFAULT_APP_SETTINGS = { | 33 | export const DEFAULT_APP_SETTINGS = { |
diff --git a/src/environment.js b/src/environment.js index ae7a67e4d..707449e09 100644 --- a/src/environment.js +++ b/src/environment.js | |||
@@ -10,6 +10,9 @@ import { | |||
10 | LIVE_WS_API, | 10 | LIVE_WS_API, |
11 | LOCAL_WS_API, | 11 | LOCAL_WS_API, |
12 | DEV_WS_API, | 12 | DEV_WS_API, |
13 | LOCAL_TODOS_FRONTEND_URL, | ||
14 | PRODUCTION_TODOS_FRONTEND_URL, | ||
15 | DEVELOPMENT_TODOS_FRONTEND_URL, | ||
13 | } from './config'; | 16 | } from './config'; |
14 | 17 | ||
15 | export const isDevMode = isDev; | 18 | export const isDevMode = isDev; |
@@ -31,21 +34,26 @@ export const cmdKey = isMac ? 'Cmd' : 'Ctrl'; | |||
31 | let api; | 34 | let api; |
32 | let wsApi; | 35 | let wsApi; |
33 | let web; | 36 | let web; |
37 | let todos; | ||
34 | if (!isDevMode || (isDevMode && useLiveAPI)) { | 38 | if (!isDevMode || (isDevMode && useLiveAPI)) { |
35 | api = LIVE_API; | 39 | api = LIVE_API; |
36 | wsApi = LIVE_WS_API; | 40 | wsApi = LIVE_WS_API; |
37 | web = LIVE_API_WEBSITE; | 41 | web = LIVE_API_WEBSITE; |
42 | todos = PRODUCTION_TODOS_FRONTEND_URL; | ||
38 | } else if (isDevMode && useLocalAPI) { | 43 | } else if (isDevMode && useLocalAPI) { |
39 | api = LOCAL_API; | 44 | api = LOCAL_API; |
40 | wsApi = LOCAL_WS_API; | 45 | wsApi = LOCAL_WS_API; |
41 | web = LOCAL_API_WEBSITE; | 46 | web = LOCAL_API_WEBSITE; |
47 | todos = LOCAL_TODOS_FRONTEND_URL; | ||
42 | } else { | 48 | } else { |
43 | api = DEV_API; | 49 | api = DEV_API; |
44 | wsApi = DEV_WS_API; | 50 | wsApi = DEV_WS_API; |
45 | web = DEV_API_WEBSITE; | 51 | web = DEV_API_WEBSITE; |
52 | todos = DEVELOPMENT_TODOS_FRONTEND_URL; | ||
46 | } | 53 | } |
47 | 54 | ||
48 | export const API = api; | 55 | export const API = api; |
49 | export const API_VERSION = 'v1'; | 56 | export const API_VERSION = 'v1'; |
50 | export const WS_API = wsApi; | 57 | export const WS_API = wsApi; |
51 | export const WEBSITE = web; | 58 | export const WEBSITE = web; |
59 | export const TODOS_FRONTEND = todos; | ||
diff --git a/src/features/todos/components/TodosWebview.js b/src/features/todos/components/TodosWebview.js index 54208d7ad..7e97c7f71 100644 --- a/src/features/todos/components/TodosWebview.js +++ b/src/features/todos/components/TodosWebview.js | |||
@@ -3,6 +3,7 @@ import PropTypes from 'prop-types'; | |||
3 | import { observer } from 'mobx-react'; | 3 | import { observer } from 'mobx-react'; |
4 | import injectSheet from 'react-jss'; | 4 | import injectSheet from 'react-jss'; |
5 | import Webview from 'react-electron-web-view'; | 5 | import Webview from 'react-electron-web-view'; |
6 | import * as environment from '../../../environment'; | ||
6 | 7 | ||
7 | const styles = theme => ({ | 8 | const styles = theme => ({ |
8 | root: { | 9 | root: { |
@@ -31,7 +32,7 @@ class TodosWebview extends Component { | |||
31 | <div className={classes.root}> | 32 | <div className={classes.root}> |
32 | <Webview | 33 | <Webview |
33 | className={classes.webview} | 34 | className={classes.webview} |
34 | src={`http://localhost:4000?authToken=${authToken}`} | 35 | src={`${environment.TODOS_FRONTEND}?authToken=${authToken}`} |
35 | /> | 36 | /> |
36 | </div> | 37 | </div> |
37 | ); | 38 | ); |