add logging HELP

This commit is contained in:
Mary Hipp 2023-04-05 14:52:43 -04:00
parent 49f88046fa
commit e2a5271612
2 changed files with 17 additions and 16 deletions

View File

@ -38,6 +38,7 @@ export default function Component({
children,
}: Props) {
useEffect(() => {
console.log('setting OPENAPI.BASE to', apiUrl);
if (apiUrl) OpenAPI.BASE = apiUrl;
}, [apiUrl]);

View File

@ -29,23 +29,23 @@ import {
} from 'services/thunks/session';
import { OpenAPI } from 'services/api';
let socket_url = `ws://${window.location.host}`;
export const socketMiddleware = () => {
let socket_url = `ws://${window.location.host}`;
console.log('socket middleware file loaded');
console.log('OPENAPI.BASE: ', OpenAPI.BASE);
// if building in package mode, replace socket url with open api base url minus the http protocol
if (OpenAPI.BASE) {
console.log('socket middleware file loaded');
console.log('OPENAPI.BASE: ', OpenAPI.BASE);
// if building in package mode, replace socket url with open api base url minus the http protocol
if (OpenAPI.BASE) {
console.log('inside statement to set URL');
//eslint-disable-next-line
socket_url = OpenAPI.BASE.replace(/^https?\:\/\//i, '');
}
}
const socket = io(socket_url, {
const socket = io(socket_url, {
timeout: 60000,
path: '/ws/socket.io',
});
});
export const socketMiddleware = () => {
let areListenersSet = false;
const middleware: Middleware =