diff --git a/demo/components/WebSocketExample.tsx b/demo/components/WebSocketExample.tsx index a9ec203..b232bfe 100644 --- a/demo/components/WebSocketExample.tsx +++ b/demo/components/WebSocketExample.tsx @@ -12,11 +12,12 @@ export interface ServerWSResponse { } export default function WebSocketExample({port = 8080}:{port?:number}){ + const server_ws_url = process.env.NODE_ENV === "production" ? `ws://localhost:${port}` : "ws://new-media.fly.dev" const [imgMetadata, setImageMetadata] = useState(); const [socket, setSocket] = useState() useEffect(() => { - const socket = new WebSocket(`ws://localhost:${port}`) + const socket = new WebSocket(server_ws_url) socket.onopen = () => { setSocket(socket) diff --git a/fly.toml b/fly.toml index c451701..911200f 100644 --- a/fly.toml +++ b/fly.toml @@ -1,5 +1,5 @@ -app = 'new-media-still-surf-1038' -primary_region = 'sjc' +app = 'new-media' +primary_region = 'ord' [build] dockerfile = 'Dockerfile.prod' @@ -16,4 +16,4 @@ primary_region = 'sjc' cpu_kind = 'performance' memory = '64gb' cpus = 16 - size = "a100-40gb" \ No newline at end of file + size = "a100-40gb"