chore: add interceptor in logging config (#55)

This commit is contained in:
Abhishek 2025-11-21 07:52:27 +05:30 committed by GitHub
parent 6efe7d6bd4
commit 451ba05c25
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 42 additions and 2 deletions

View file

@ -65,7 +65,13 @@
let apiBaseUrl = DEFAULT_CONFIG.apiBaseUrl;
if (apiEndpoint) {
// Use the apiEndpoint from URL parameter if provided
apiBaseUrl = apiEndpoint.replace(/\/+$/, ''); // Remove trailing slashes
// Ensure it has a protocol
if (!apiEndpoint.startsWith('http://') && !apiEndpoint.startsWith('https://')) {
// Default to https for production endpoints
apiBaseUrl = 'https://' + apiEndpoint.replace(/\/+$/, '');
} else {
apiBaseUrl = apiEndpoint.replace(/\/+$/, ''); // Remove trailing slashes
}
} else if (scriptUrl.origin.includes('localhost')) {
apiBaseUrl = 'http://localhost:8000';
} else {