Commit d39221b 1 parent ae9612f commit d39221b Copy full SHA for d39221b
File tree 4 files changed +5
-17
lines changed
4 files changed +5
-17
lines changed Original file line number Diff line number Diff line change 1
- REACT_APP_API_SCHEME = http
2
- REACT_APP_API_HOST = localhost
3
- REACT_APP_API_PORT = 8080
1
+ REACT_APP_API_URL = http://localhost:8080
4
2
REACT_APP_API_PATH = /api/v1
Original file line number Diff line number Diff line change 1
- REACT_APP_API_SCHEME=REACT_APP_API_SCHEME_PLACEHOLDER
2
- REACT_APP_API_HOST=REACT_APP_API_HOST_PLACEHOLDER
3
- REACT_APP_API_PORT=REACT_APP_API_PORT_PLACEHOLDER
1
+ REACT_APP_API_URL=REACT_APP_API_URL_PLACEHOLDER
4
2
REACT_APP_API_PATH=REACT_APP_API_PATH_PLACEHOLDER
Original file line number Diff line number Diff line change @@ -4,8 +4,6 @@ set -eux -o pipefail
4
4
5
5
for file in /app/static/js/* .js;
6
6
do
7
- sed -i ' s|REACT_APP_API_SCHEME_PLACEHOLDER|' ${REACT_APP_API_SCHEME} ' |g' $file
8
- sed -i ' s|REACT_APP_API_HOST_PLACEHOLDER|' ${REACT_APP_API_HOST} ' |g' $file
9
- sed -i ' s|REACT_APP_API_PORT_PLACEHOLDER|' ${REACT_APP_API_PORT} ' |g' $file
7
+ sed -i ' s|REACT_APP_API_URL_PLACEHOLDER|' ${REACT_APP_API_URL} ' |g' $file
10
8
sed -i ' s|REACT_APP_API_PATH_PLACEHOLDER|' ${REACT_APP_API_PATH} ' |g' $file
11
9
done
Original file line number Diff line number Diff line change 1
1
import { getCookie } from "../cookie/cookie" ;
2
2
3
3
/** Scheme for all API requests. */
4
- export const API_SCHEME = process . env . REACT_APP_API_SCHEME ;
5
-
6
- /** The host for the API server. */
7
- export const API_HOST = process . env . REACT_APP_API_HOST ;
8
-
9
- /** The port for the API server. */
10
- export const API_PORT = process . env . REACT_APP_API_PORT ;
4
+ export const API_URL = process . env . REACT_APP_API_URL ;
11
5
12
6
/** The base path for all API requests. */
13
7
export const API_PATH = process . env . REACT_APP_API_PATH ;
14
8
15
9
/** The base url for all API requests. */
16
- export const API_BASE_URL = `${ API_SCHEME } :// ${ API_HOST } : ${ API_PORT } ${ API_PATH } ` ;
10
+ export const API_BASE_URL = `${ API_URL } ${ API_PATH } ` ;
17
11
18
12
/**
19
13
* Makes an actual fetch request to the API, should be used by all other API implementations.
You can’t perform that action at this time.
0 commit comments