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:
254254 " @type " : type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
255255 codec_type : AUTO
256256 stat_prefix : ingress_http
257+ upgrade_configs :
258+ - upgrade_type : websocket
257259 route_config :
258260 name : local_route
259261 virtual_hosts :
Original file line number Diff line number Diff line change 11PORT = 3001
22# 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
1010ARG API_URL_PREFIX
1111ENV REACT_APP_API_URL_PREFIX ${API_URL_PREFIX}
1212
13+ ARG WS_URL_PREFIX
14+ ENV REACT_APP_WS_URL_PREFIX ${WS_URL_PREFIX}
15+
1316RUN npm run build -w @postgres.ai/ce
1417
1518# Run phase.
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ for tag in "${ADDR[@]}"; do
2424done
2525
2626set -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 .
2828set +x
2929
3030echo -e " $tags_push " | while read -r tag; do
Original file line number Diff line number Diff line change 11import { InitWS } from "@postgres.ai/shared/types/api/endpoints/initWS" ;
2+ import { WS_URL_PREFIX } from 'config/env'
23
34export 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 ) ;
56 url . protocol = url . protocol . replace ( 'http' , 'ws' ) ;
67 const wsAddr = url . href + '?token=' + token ;
78
Original file line number Diff line number Diff line change 11export const NODE_ENV = process . env . NODE_ENV
22export const API_URL_PREFIX = process . env . REACT_APP_API_URL_PREFIX ?? ''
3+ export const WS_URL_PREFIX = process . env . REACT_APP_WS_URL_PREFIX ?? ''
34export const BUILD_TIMESTAMP = process . env . BUILD_TIMESTAMP
Original file line number Diff line number Diff line change 44declare namespace NodeJS {
55 interface ProcessEnv {
66 readonly REACT_APP_API_URL_PREFIX ?: string
7+ readonly REACT_APP_WS_URL_PREFIX ?: string
78 readonly BUILD_TIMESTAMP : number
89 }
910}
You can’t perform that action at this time.
0 commit comments