Added base url in signalrServies

This commit is contained in:
ashutosh.nehete 2025-06-11 12:23:39 +05:30
parent 053dfaf197
commit 732a6901ee

View File

@ -3,7 +3,8 @@ import { clearCacheKey, getCachedData } from "../slices/apiDataManager";
import showToast from "./toastService";
import eventBus from "./eventBus";
import { useSelector } from "react-redux";
// const base_Url = process.env.VITE_BASE_URL;
const base_Url = "https://devapi.marcoaiot.com";
let connection = null;
const targetPath = "";
@ -11,7 +12,7 @@ const targetPath = "";
export function startSignalR(loggedUser) {
console.log(loggedUser?.employeeInfo.id);
connection = new signalR.HubConnectionBuilder()
.withUrl("http://localhost:5032/hubs/marco", {
.withUrl(`${base_Url}/hubs/marco`, {
accessTokenFactory: () => localStorage.getItem("jwtToken"),
withCredentials: false,
})