client: split URLS out into env vars
This commit is contained in:
parent
bdf043203f
commit
2fc4db34e9
5 changed files with 12 additions and 5 deletions
3
.env
3
.env
|
@ -1,2 +1,5 @@
|
|||
HOST=local-development.ury.org.uk
|
||||
REACT_APP_VERSION=$npm_package_version
|
||||
REACT_APP_MYRADIO_NONAPI_BASE=https://ury.org.uk/myradio-staging
|
||||
REACT_APP_MYRADIO_BASE=https://ury.org.uk/api-staging/v2
|
||||
REACT_APP_WS_URL=wss://audio.ury.org.uk/webstudio/stream
|
4
.env.prod
Normal file
4
.env.prod
Normal file
|
@ -0,0 +1,4 @@
|
|||
REACT_APP_VERSION=$npm_package_version
|
||||
REACT_APP_MYRADIO_NONAPI_BASE=https://ury.org.uk/myradio
|
||||
REACT_APP_MYRADIO_BASE=https://ury.org.uk/api/v2
|
||||
REACT_APP_WS_URL=wss://audio.ury.org.uk/webstudio/stream
|
1
Jenkinsfile
vendored
1
Jenkinsfile
vendored
|
@ -30,6 +30,7 @@ pipeline {
|
|||
environment {
|
||||
REACT_APP_MYRADIO_NONAPI_BASE = 'https://ury.org.uk/myradio'
|
||||
REACT_APP_MYRADIO_BASE = 'https://ury.org.uk/api/v2'
|
||||
REACT_APP_WS_URL = 'wss://audio.ury.org.uk/webstudio/stream'
|
||||
}
|
||||
steps {
|
||||
sh 'sed -i -e \'s/ury.org.uk\\/webstudio-dev/ury.org.uk\\/webstudio/\' package.json'
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
import qs from "qs";
|
||||
|
||||
export const MYRADIO_NON_API_BASE =
|
||||
process.env.REACT_APP_MYRADIO_NONAPI_BASE ||
|
||||
"https://ury.org.uk/myradio-staging";
|
||||
process.env.REACT_APP_MYRADIO_NONAPI_BASE!;
|
||||
export const MYRADIO_BASE_URL =
|
||||
process.env.REACT_APP_MYRADIO_BASE || "https://ury.org.uk/api-staging/v2";
|
||||
process.env.REACT_APP_MYRADIO_BASE!;
|
||||
const MYRADIO_API_KEY = process.env.REACT_APP_MYRADIO_KEY!;
|
||||
|
||||
class ApiException extends Error {}
|
||||
|
|
|
@ -42,7 +42,7 @@ export class WebRTCStreamer extends Streamer {
|
|||
}
|
||||
|
||||
async start(): Promise<void> {
|
||||
this.ws = new WebSocket("ws://audio.ury.org.uk/webstudio/stream");
|
||||
this.ws = new WebSocket(process.env.REACT_APP_WS_URL!);
|
||||
this.ws.onopen = e => {
|
||||
console.log("WS open");
|
||||
this.onStateChange(this.mapStateToConnectionState());
|
||||
|
|
Loading…
Reference in a new issue