fea(frontend): add WS_SERVER_ADDRESS env
This commit is contained in:
parent
c916eef54e
commit
9dedc31626
@ -18,4 +18,10 @@ yarn dev
|
||||
|
||||
### Development Dependencies
|
||||
|
||||
This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions.
|
||||
This package depends on the local packages `@mancala/core` and `mancala.js`. Refer to their documentation for further instructions.
|
||||
|
||||
### Docker Build
|
||||
|
||||
```bash
|
||||
docker build --build-arg SERVER_ADDRESS=http://localhost:5000 --build-arg WS_SERVER_ADDRESS=http://localhost:5000 -t mancala-frontend .
|
||||
```
|
||||
@ -5,13 +5,14 @@ export type Server = {
|
||||
wsServerAdress: string;
|
||||
};
|
||||
|
||||
export const LOCAL_PORT='localhost:5005';
|
||||
export const LOCAL_SERVER_ADDRESS='http://localhost:5005';
|
||||
export const LOCAL_WS_SERVER_ADDRESS='http://localhost:5005';
|
||||
|
||||
export const server: Server = {
|
||||
//@ts-ignore
|
||||
serverAdress: process.env.SERVER_ADDRESS ? `https://${process.env.SERVER_ADDRESS}` : 'http://' + LOCAL_PORT,
|
||||
serverAdress: process.env.SERVER_ADDRESS ? `${process.env.SERVER_ADDRESS}` : LOCAL_PORT,
|
||||
//@ts-ignore
|
||||
wsServerAdress: process.env.SERVER_ADDRESS ? `wss://${process.env.SERVER_ADDRESS}` : 'ws://' + LOCAL_PORT,
|
||||
wsServerAdress: process.env.WS_SERVER_ADDRESS ? `${process.env.WS_SERVER_ADDRESS}` : LOCAL_WS_SERVER_ADDRESS,
|
||||
}
|
||||
|
||||
export const RTMT_WS_PING_INTERVAL = 1000, RTMT_WS_PING_INTERVAL_BUFFER_TIME = 2000;
|
||||
Loading…
Reference in New Issue
Block a user