fix: topology container height
This commit is contained in:
@@ -2,7 +2,20 @@
|
||||
|
||||
class ApiClient {
|
||||
constructor() {
|
||||
this.baseUrl = (typeof window !== 'undefined' && window.API_BASE_URL) || 'http://localhost:3001'; // Backend server URL
|
||||
// Auto-detect server URL based on current location
|
||||
const currentHost = window.location.hostname;
|
||||
const currentPort = window.location.port;
|
||||
|
||||
// If accessing from localhost, use localhost:3001
|
||||
// If accessing from another device, use the same hostname but port 3001
|
||||
if (currentHost === 'localhost' || currentHost === '127.0.0.1') {
|
||||
this.baseUrl = 'http://localhost:3001';
|
||||
} else {
|
||||
// Use the same hostname but port 3001
|
||||
this.baseUrl = `http://${currentHost}:3001`;
|
||||
}
|
||||
|
||||
console.log('API Client initialized with base URL:', this.baseUrl);
|
||||
}
|
||||
|
||||
async request(path, { method = 'GET', headers = {}, body = undefined, query = undefined, isForm = false } = {}) {
|
||||
|
||||
Reference in New Issue
Block a user