|
@@ -1,17 +1,8 @@
|
|
|
import type { BaaSClientConfig } from '@picobaas/client';
|
|
import type { BaaSClientConfig } from '@picobaas/client';
|
|
|
|
|
|
|
|
-// When served from the backend's public folder, API is on the same origin
|
|
|
|
|
-const isSecure = window.location.protocol === 'https:';
|
|
|
|
|
-const defaultPort = isSecure ? 443 : 80;
|
|
|
|
|
-const currentPort = window.location.port ? parseInt(window.location.port) : defaultPort;
|
|
|
|
|
-
|
|
|
|
|
export const config: BaaSClientConfig = {
|
|
export const config: BaaSClientConfig = {
|
|
|
- // Use the same host/port as the current page (backend serves both static files and API)
|
|
|
|
|
- apiHost: window.location.hostname,
|
|
|
|
|
- apiPort: currentPort,
|
|
|
|
|
- wsHost: window.location.hostname,
|
|
|
|
|
- wsPort: currentPort, // WebSocket on same port as API
|
|
|
|
|
- secure: isSecure,
|
|
|
|
|
|
|
+ // Use the current page origin (backend serves both static files and API)
|
|
|
|
|
+ domain: window.location.origin,
|
|
|
autoRefresh: true,
|
|
autoRefresh: true,
|
|
|
storageKey: 'imagedrop_auth',
|
|
storageKey: 'imagedrop_auth',
|
|
|
};
|
|
};
|