mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-25 08:48:13 +02:00
chore: add interceptor in logging config (#55)
This commit is contained in:
parent
6efe7d6bd4
commit
451ba05c25
2 changed files with 42 additions and 2 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue