diff --git a/web/src/grpcweb.ts b/web/src/grpcweb.ts index 9e920677..347782fb 100644 --- a/web/src/grpcweb.ts +++ b/web/src/grpcweb.ts @@ -5,10 +5,8 @@ import { SystemServiceDefinition } from "./types/proto/api/v2/system_service"; import { TagServiceDefinition } from "./types/proto/api/v2/tag_service"; import { UserServiceDefinition } from "./types/proto/api/v2/user_service"; -const address = import.meta.env.MODE === "development" ? "http://localhost:8081" : window.location.origin; - const channel = createChannel( - address, + window.location.origin, FetchTransport({ credentials: "include", }) diff --git a/web/vite.config.ts b/web/vite.config.ts index d92719d9..791a1f93 100644 --- a/web/vite.config.ts +++ b/web/vite.config.ts @@ -19,6 +19,10 @@ export default defineConfig({ target: devProxyServer, xfwd: true, }, + "^/memos.api.v2": { + target: devProxyServer, + xfwd: true, + }, "^/o/": { target: devProxyServer, xfwd: true,