forked from Github/frigate
get ingress to play nice with vite
This commit is contained in:
@@ -1,2 +1,2 @@
|
||||
import { API_HOST } from '../env';
|
||||
export const baseUrl = API_HOST || `${window.location.protocol}//${window.location.host}${window.baseUrl || ''}`;
|
||||
export const baseUrl = API_HOST || `${window.location.protocol}//${window.location.host}${window.baseUrl || '/'}`;
|
||||
|
||||
@@ -4,7 +4,7 @@ import useSWR, { SWRConfig } from 'swr';
|
||||
import { MqttProvider } from './mqtt';
|
||||
import axios from 'axios';
|
||||
|
||||
axios.defaults.baseURL = `${baseUrl}/api/`;
|
||||
axios.defaults.baseURL = `${baseUrl}api/`;
|
||||
|
||||
export function ApiProvider({ children, options }) {
|
||||
return (
|
||||
|
||||
@@ -34,7 +34,7 @@ export function MqttProvider({
|
||||
config,
|
||||
children,
|
||||
createWebsocket = defaultCreateWebsocket,
|
||||
mqttUrl = `${baseUrl.replace(/^http/, 'ws')}/ws`,
|
||||
mqttUrl = `${baseUrl.replace(/^http/, 'ws')}ws`,
|
||||
}) {
|
||||
const [state, dispatch] = useReducer(reducer, initialState);
|
||||
const wsRef = useRef();
|
||||
|
||||
Reference in New Issue
Block a user