We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 363ae79 commit 54c5e9fCopy full SHA for 54c5e9f
1 file changed
src/utils/Socket.tsx
@@ -1,19 +1,13 @@
1
import { io } from "socket.io-client";
2
3
-const isNetlify = import.meta.env.VITE_IS_NETLIFY === "true";
4
-
5
-// If on Netlify, use a relative path to trigger the netlify.toml proxy
6
-// Otherwise, use the direct Render URL (for Cloudflare Pages or local dev)
7
const URL = import.meta.env.PROD
8
- ? isNetlify
9
- ? "/"
10
- : "https://goobapp-backend-tsil.onrender.com"
+ ? "https://goobapp-backend-tsil.onrender.com"
11
: "http://localhost:3000";
12
13
export const SERVER_URL = URL;
14
15
export const socket = io(URL, {
16
autoConnect: false,
17
- path: isNetlify ? "/api/socket.io" : "/socket.io",
+ path: "/socket.io",
18
transports: ["polling", "websocket"],
19
});
0 commit comments