Now supports running under a sub path

Just set the SPOOLMAN_BASE_PATH environment variable and it should work.

Resolves #95
This commit is contained in:
Donkie
2024-05-10 11:36:33 +02:00
parent fc532ff697
commit bc32f1e890
18 changed files with 158 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
import { useQuery } from "@tanstack/react-query";
import { Spin, Typography } from "antd";
import { getAPIURL } from "../utils/url";
const { Text } = Typography;
@@ -15,12 +16,10 @@ interface IInfo {
}
export const Version: React.FC = () => {
const apiEndpoint = import.meta.env.VITE_APIURL;
const infoResult = useQuery<IInfo>({
queryKey: ["info"],
queryFn: async () => {
const response = await fetch(apiEndpoint + "/info");
const response = await fetch(getAPIURL() + "/info");
if (!response.ok) {
throw new Error("Network response was not ok");
}