api DEV_TO_PROD
This commit is contained in:
parent
088f086cef
commit
5c3338fd9d
@ -4,6 +4,8 @@ import {map, Subscription} from 'rxjs';
|
|||||||
import {StompService} from '@stomp/ng2-stompjs';
|
import {StompService} from '@stomp/ng2-stompjs';
|
||||||
import {FromJson, Next} from './types';
|
import {FromJson, Next} from './types';
|
||||||
|
|
||||||
|
const DEV_TO_PROD = false;
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
@ -40,6 +42,9 @@ export class ApiService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static url(protocol: string, path: any[]) {
|
static url(protocol: string, path: any[]) {
|
||||||
return `${protocol}${location.protocol.endsWith('s') ? 's' : ''}://${location.hostname}:8081/${path.join('/')}`;
|
const host = DEV_TO_PROD ? '10.255.0.1' : location.hostname;
|
||||||
|
const port = 8081;
|
||||||
|
return `${protocol}${location.protocol.endsWith('s') ? 's' : ''}://${host}:${port}/${path.join('/')}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user