Skip to content

Commit

Permalink
Add websocket proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Somnath-Chattaraj committed Oct 12, 2024
1 parent e6a75b6 commit 0f7b9a0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
8 changes: 7 additions & 1 deletion frontend/vercel.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,17 @@
"rewrites": [
{
"source": "/api/:match*",
"destination": "https://api123.campusify.site/api/:match*"
"destination": "https://chatterapi.campusify.site/api/:match*"
},
{
"source": "/(.*)",
"destination": "/"
}
],
"proxies": [
{
"source": "/ws/:match*",
"destination": "wss://realtime.campusify.site/:match*"
}
]
}
5 changes: 5 additions & 0 deletions frontend/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export default defineConfig({
target: process.env.VITE_BACKEND_URL,
changeOrigin: true,
},
"/ws": {
target: process.env.VITE_WEBSOCKET_URL,
changeOrigin: true,
ws: true,
},
},
},
});

0 comments on commit 0f7b9a0

Please sign in to comment.