omni frontend

This commit is contained in:
Brandon Thomas committed 2026-04-07 02:32:09 -04:00
1 parent badabe57eb
commit 22ba7338cd
4 files changed
+19 -13

No files matched your search

@@ -17,8 +17,8 @@ import { TaskQueue } from "./task-queue";
const NAV_ITEMS = [
{ name: "Home", href: "/" },
// { name: "Image", href: "/create-image" },
// { name: "Video", href: "/create-video" },
{ name: "Image", href: "/create-image" },
{ name: "Video", href: "/create-video" },
{ name: "Tutorials", href: "/tutorials" },
{ name: "News", href: "/news" },
{ name: "FAQ", href: "/faq" },
+10 -9
View File
@@ -11,15 +11,16 @@ const root = ReactDOM.createRoot(
document.getElementById("root") as HTMLElement,
);
// In development, route API through the Vite dev server origin to avoid CORS
if (import.meta.env.DEV) {
try {
const origin = window.location.origin;
StorytellerApiHostStore.getInstance().setApiSchemeAndHost(origin);
} catch (e) {
console.warn("Failed to set dev API host override", e);
}
}
// In development, route API through the Vite dev server proxy to avoid CORS,
// unless VITE_API_HOST is explicitly set (eg. for an unsafe browser that ignores CORS).
//if (import.meta.env.DEV && !import.meta.env.VITE_API_HOST) {
// try {
// const origin = window.location.origin;
// StorytellerApiHostStore.getInstance().setApiSchemeAndHost(origin);
// } catch (e) {
// console.warn("Failed to set dev API host override", e);
// }
//}
// Cache the referrer immediately — it can change or disappear on navigation.
// Only set once so subsequent in-site navigations don't overwrite the original.
+3 -1
View File
@@ -26,7 +26,9 @@ export class ApiManager {
}
protected getApiSchemeAndHost(): string {
return StorytellerApiHostStore.getInstance().getApiSchemeAndHost();
const host = StorytellerApiHostStore.getInstance().getApiSchemeAndHost();
console.log('getSchemaAndHost()', host);
return host;
}
public async fetch<B, T>(
@@ -1,5 +1,8 @@
// Artcraft / Storyteller API backend
const DEFAULT_API_HOST = "https://api.storyteller.ai";
// Set VITE_API_HOST=http://localhost:12345 for local dev, or leave unset for production.
//const DEFAULT_API_HOST = (import.meta as any).env?.VITE_API_HOST || "https://api.storyteller.ai";
const DEFAULT_API_HOST = "http://localhost:12345";
// NB(bt,2025-09-25): 'nx' is creating multiple copies of the library with name
// mangling, so the singleton pattern fails to resolve to a single instance.