-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53 from CS3219-AY2425S1/fix-cors
Fix cors
- Loading branch information
Showing
6 changed files
with
132 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
|
||
# API endpoints | ||
# without port | ||
REACT_APP_API_BASE_URL=http://localhost | ||
REACT_APP_API_BASE_URL=http://localhost |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,33 @@ | ||
import { SVC_ENDPOINTS } from "./consts/api"; | ||
import { io } from 'socket.io-client'; | ||
import { io } from "socket.io-client"; | ||
|
||
export const matchingSocket = io(SVC_ENDPOINTS.matching, { | ||
autoConnect: false | ||
}) | ||
const isProduction = | ||
process.env.REACT_APP_API_BASE_URL && | ||
process.env.REACT_APP_API_BASE_URL !== "http://localhost"; | ||
|
||
export const collaborationSocket = io(SVC_ENDPOINTS.collaboration, { | ||
autoConnect: false | ||
}) | ||
export const matchingSocket = isProduction | ||
? io(process.env.REACT_APP_API_BASE_URL, { | ||
path: "/matching", | ||
autoConnect: false, | ||
}) | ||
: io(SVC_ENDPOINTS.matching, { | ||
autoConnect: false, | ||
}); | ||
|
||
export const chatSocket = io(SVC_ENDPOINTS.chat, { | ||
autoConnect: false | ||
}) | ||
export const collaborationSocket = isProduction | ||
? io(process.env.REACT_APP_API_BASE_URL, { | ||
path: "/collaboration", | ||
autoConnect: false, | ||
}) | ||
: io(SVC_ENDPOINTS.collaboration, { | ||
autoConnect: false, | ||
}); | ||
|
||
export const chatSocket = isProduction | ||
? io(process.env.REACT_APP_API_BASE_URL, { | ||
path: "/chat", | ||
autoConnect: false, | ||
}) | ||
: io(SVC_ENDPOINTS.chat, { | ||
autoConnect: false, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters