Skip to content

Commit

Permalink
Update WebSocket URL and Vite server origin to use production URL
Browse files Browse the repository at this point in the history
  • Loading branch information
TranHVLoc committed Dec 11, 2024
1 parent 0238179 commit 13b3823
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions client/src/context/SocketContextProvider.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import { retrieveEnvironmentVariable } from '../services/RetrieveEnvironmentVari
import { MessageContext } from './MessageContextProvider';
import { useMemo } from 'react';

// const url = `${retrieveEnvironmentVariable('VITE_BACKEND_URL')}:${retrieveEnvironmentVariable(
// 'VITE_BACKEND_PORT',
// )}`;
const url = `${retrieveEnvironmentVariable('VITE_BACKEND_URL')}/socket.io`;
const url = `${retrieveEnvironmentVariable('VITE_BACKEND_URL_PROD')}/socket.io`;
const SocketContext = createContext();

const SocketContextProvider = ({ children }) => {
Expand Down
2 changes: 1 addition & 1 deletion client/vite.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export default defineConfig(({ mode }) => {
strictPort: true,
},
server: {
origin: JSON.stringify(env.VITE_BACKEND_URL),
origin: JSON.stringify(env.VITE_BACKEND_URL_PROD),
port: 5173,
host: true,
},
Expand Down

0 comments on commit 13b3823

Please sign in to comment.