-
Notifications
You must be signed in to change notification settings - Fork 0
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 #40 from ddddddO/endpoint
Endpoint
- Loading branch information
Showing
6 changed files
with
26 additions
and
19 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
4 changes: 2 additions & 2 deletions
4
...mon-api/web/dist/assets/index-Cijq9ZZc.js → ...mon-api/web/dist/assets/index-Dw3tDLHo.js
Large diffs are not rendered by default.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
export const getEndpoint = (): string => { | ||
const loc = window.location | ||
return loc.hostname === 'localhost' | ||
? 'http://localhost:8082/packet' | ||
: loc.protocol + '//' + loc.host + '/packet' | ||
} | ||
|
||
export const getEndpointWS = (): string => { | ||
const endpoint: string = (() => { | ||
const loc = window.location | ||
const protocol = loc.protocol === 'https:' ? 'wss:' : 'ws:' | ||
return protocol + '//' + loc.host + loc.pathname + 'ws' | ||
})() | ||
|
||
const endpointDev: string = "ws://localhost:8082/ws" | ||
return window.location.hostname === 'localhost' ? endpointDev : endpoint | ||
} |
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