diff --git a/build.rs b/build.rs index 1b43176..1b84e69 100644 --- a/build.rs +++ b/build.rs @@ -2,6 +2,7 @@ use static_files::NpmBuild; fn main() -> std::io::Result<()> { NpmBuild::new("./ui") + .change_detection() .install() .expect("Failed to run npm install") .run("build") diff --git a/src/main.rs b/src/main.rs index 4e55312..53bbb52 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,7 +22,7 @@ async fn main() -> Result<()> { let generated = generate(); App::new() .service(get_version_data::get_version_data) - .service(ResourceFiles::new("/printnanny/ui/*", generated).resolve_not_found_to_root()) + .service(ResourceFiles::new("/*", generated)) }) .workers(config.workers) .bind((config.host, config.port))? diff --git a/ui/.env/.env b/ui/.env/.env index dbb0aec..f0987fb 100644 --- a/ui/.env/.env +++ b/ui/.env/.env @@ -1,4 +1,3 @@ -VITE_PRINTNANNY_EDGE_API_URL = "http://localhost:8080" VITE_PRINTNANNY_CLOUD_API_URL = "https://printnanny.ai" VITE_PRINTNANNY_EDGE_NATS_WS_PORT = "8844" @@ -6,6 +5,4 @@ VITE_PRINTNANNY_EDGE_JANUS_WS_PORT = "8188" VITE_POSTHOG_CLIENT_KEY = "phc_if1FbWP98XhFJMRt9ISTp1NvOe9MExeTNG9pH05c50P" VITE_POSTHOG_API_URL = "https://app.posthog.com" -VITE_BASE_URL=/printnanny/ui/ -VITE_BASE_UI_URL=/printnanny/ui/ VITE_BASE_API_URL=/printnanny/api/ diff --git a/ui/package.json b/ui/package.json index 76aec9e..b61457b 100644 --- a/ui/package.json +++ b/ui/package.json @@ -3,13 +3,13 @@ "version": "0.1.0", "browser": "main.ts", "scripts": { - "dev": "vite --mode dev --base=/printnanny/ui/", + "dev": "vite --mode dev", "build": "run-p type-check build-only", "preview": "vite preview --port 4173", "test:unit": "vitest --environment jsdom", "test:e2e": "start-server-and-test preview http://localhost:4173/ 'cypress open --e2e'", "test:e2e:ci": "start-server-and-test preview http://localhost:4173/ 'cypress run --e2e'", - "build-only": "vite build --base=/printnanny/ui/", + "build-only": "vite build", "type-check": "vue-tsc --noEmit -p tsconfig.vitest.json --composite false", "lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore", "lint:fix": "eslint . --fix --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore" diff --git a/ui/src/router/index.ts b/ui/src/router/index.ts index 0d96a54..c8d5383 100644 --- a/ui/src/router/index.ts +++ b/ui/src/router/index.ts @@ -4,7 +4,7 @@ import { useCloudStore } from "@/stores/cloud"; import { AllRoutes } from "./routes"; const router = createRouter({ - history: createWebHistory(import.meta.env.VITE_BASE_UI_URL), + history: createWebHistory('/'), routes: AllRoutes, });