mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server dashboard updated to use new REST API path
parent
0e3e82d7e1
commit
3bfbc37d5e
|
@ -7,6 +7,7 @@ import { throwError } from 'rxjs';
|
||||||
export class RestService {
|
export class RestService {
|
||||||
|
|
||||||
private openviduPublicUrl: string;
|
private openviduPublicUrl: string;
|
||||||
|
private API_PATH: string = 'openvidu/api';
|
||||||
|
|
||||||
constructor(private httpClient: HttpClient) { }
|
constructor(private httpClient: HttpClient) { }
|
||||||
|
|
||||||
|
@ -16,7 +17,7 @@ export class RestService {
|
||||||
resolve(this.openviduPublicUrl);
|
resolve(this.openviduPublicUrl);
|
||||||
} else {
|
} else {
|
||||||
this.httpClient.get(location.protocol + '//' + location.hostname + ((!!location.port) ? (':' + location.port) : '') +
|
this.httpClient.get(location.protocol + '//' + location.hostname + ((!!location.port) ? (':' + location.port) : '') +
|
||||||
'/config/openvidu-publicurl', { responseType: 'text' }).pipe(
|
'/' + this.API_PATH + '/config/openvidu-publicurl', { responseType: 'text' }).pipe(
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
return throwError(error);
|
return throwError(error);
|
||||||
|
@ -44,7 +45,7 @@ export class RestService {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
this.httpClient.post(this.openviduPublicUrl + 'api/sessions', body, options)
|
this.httpClient.post(this.openviduPublicUrl + this.API_PATH + '/sessions', body, options)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
@ -66,7 +67,7 @@ export class RestService {
|
||||||
'Content-Type': 'application/json'
|
'Content-Type': 'application/json'
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
this.httpClient.post(this.openviduPublicUrl + 'api/tokens', body, options)
|
this.httpClient.post(this.openviduPublicUrl + this.API_PATH + '/tokens', body, options)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(error => {
|
catchError(error => {
|
||||||
reject(error);
|
reject(error);
|
||||||
|
|
Loading…
Reference in New Issue