Skip to content

Commit ab961a1

Browse files
committed
Update WebSocket URL to use Render.com deployment
1 parent 5c7f15d commit ab961a1

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/config.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
const config = {
2+
// Development WebSocket URL (local testing)
3+
development: 'ws://localhost:3001',
4+
5+
// Production WebSocket URL (using Render.com URL)
6+
production: 'wss://discord-clone-websocket.onrender.com',
7+
8+
// Get the appropriate WebSocket URL based on environment
9+
get websocketUrl() {
10+
if (window.location.hostname === 'localhost') {
11+
return this.development;
12+
}
13+
return this.production;
14+
}
15+
};
16+
17+
export default config;

0 commit comments

Comments
 (0)