File tree Expand file tree Collapse file tree 7 files changed +11
-2
lines changed Expand file tree Collapse file tree 7 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -254,6 +254,8 @@ static_resources:
254
254
" @type " : type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
255
255
codec_type : AUTO
256
256
stat_prefix : ingress_http
257
+ upgrade_configs :
258
+ - upgrade_type : websocket
257
259
route_config :
258
260
name : local_route
259
261
virtual_hosts :
Original file line number Diff line number Diff line change 1
1
PORT = 3001
2
2
# REACT_APP_API_URL_PREFIX
3
+ # REACT_APP_WS_URL_PREFIX
Original file line number Diff line number Diff line change @@ -10,6 +10,9 @@ RUN npm ci -ws
10
10
ARG API_URL_PREFIX
11
11
ENV REACT_APP_API_URL_PREFIX ${API_URL_PREFIX}
12
12
13
+ ARG WS_URL_PREFIX
14
+ ENV REACT_APP_WS_URL_PREFIX ${WS_URL_PREFIX}
15
+
13
16
RUN npm run build -w @postgres.ai/ce
14
17
15
18
# Run phase.
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ for tag in "${ADDR[@]}"; do
24
24
done
25
25
26
26
set -x
27
- docker build --build-arg API_URL_PREFIX=/api $tags_build --file ./ui/packages/ce/Dockerfile .
27
+ docker build --build-arg API_URL_PREFIX=/api --build-arg WS_URL_PREFIX=/ws $tags_build --file ./ui/packages/ce/Dockerfile .
28
28
set +x
29
29
30
30
echo -e " $tags_push " | while read -r tag; do
Original file line number Diff line number Diff line change 1
1
import { InitWS } from "@postgres.ai/shared/types/api/endpoints/initWS" ;
2
+ import { WS_URL_PREFIX } from 'config/env'
2
3
3
4
export const initWS : InitWS = ( path : string , token : string ) : WebSocket => {
4
- let url = new URL ( '/ws' + path , window . location . href ) ;
5
+ let url = new URL ( WS_URL_PREFIX + path , window . location . href ) ;
5
6
url . protocol = url . protocol . replace ( 'http' , 'ws' ) ;
6
7
const wsAddr = url . href + '?token=' + token ;
7
8
Original file line number Diff line number Diff line change 1
1
export const NODE_ENV = process . env . NODE_ENV
2
2
export const API_URL_PREFIX = process . env . REACT_APP_API_URL_PREFIX ?? ''
3
+ export const WS_URL_PREFIX = process . env . REACT_APP_WS_URL_PREFIX ?? ''
3
4
export const BUILD_TIMESTAMP = process . env . BUILD_TIMESTAMP
Original file line number Diff line number Diff line change 4
4
declare namespace NodeJS {
5
5
interface ProcessEnv {
6
6
readonly REACT_APP_API_URL_PREFIX ?: string
7
+ readonly REACT_APP_WS_URL_PREFIX ?: string
7
8
readonly BUILD_TIMESTAMP : number
8
9
}
9
10
}
You can’t perform that action at this time.
0 commit comments