api DEV_TO_PROD

This commit is contained in:
Patrick Haßel 2025-02-28 08:44:12 +01:00
parent 088f086cef
commit 5c3338fd9d

View File

@ -4,6 +4,8 @@ import {map, Subscription} from 'rxjs';
import {StompService} from '@stomp/ng2-stompjs';
import {FromJson, Next} from './types';
const DEV_TO_PROD = false;
@Injectable({
providedIn: 'root'
})
@ -40,6 +42,9 @@ export class ApiService {
}
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('/')}`;
}
}