Skip to content

Commit 679617f

Browse files
committed
build: Update localhost to each deployed host address, and then Change the host address string to ENVIRONMENT_VARIABLE. #16
1 parent 9448221 commit 679617f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

client/app/src/apis/instance.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
const { REACT_APP_HOST_ADDRESS, REACT_APP_SERVER_PORT } = process.env;
2+
13
export class HTTP {
24
private domain: string = "";
35

@@ -40,6 +42,8 @@ export class HTTP {
4042
}
4143
}
4244

43-
const instance = new HTTP("http://localhost:8000");
45+
const instance = new HTTP(
46+
`http://${REACT_APP_HOST_ADDRESS}:${REACT_APP_SERVER_PORT}`
47+
);
4448

4549
export default instance;

config/.client.env

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,8 @@
1+
# Client port number to open this react-app.
12
PORT=3000
2-
HOST_ADDRESS="localhost" # Put the IP or host address of the computer you are using.
3+
4+
# Enter the same value as the PORT environment variable written in .server.env.
5+
REACT_APP_SERVER_PORT=8000
6+
7+
# Put the IP or host address of the computer you are using.
8+
REACT_APP_HOST_ADDRESS="localhost"

0 commit comments

Comments
 (0)