Skip to content

Shared task board where people and AI coding agents work as teammates. Source-available, self-hostable.

Go

fix(web): remove API proxy, use direct backend requests

Naiyuan Qing78543d718739
diff --git a/apps/web/.env.development b/apps/web/.env.development
index d2f8657001..8de8c75500 100644
--- a/apps/web/.env.development
+++ b/apps/web/.env.development
@@ -1 +1,4 @@
+# Frontend direct API request (browser-accessible)
+NEXT_PUBLIC_API_URL=https://api-dev.copilothub.ai
+# Core package still uses this
MULTICA_API_URL=https://api-dev.copilothub.ai
diff --git a/apps/web/lib/constant.ts b/apps/web/lib/constant.ts
index 692db15856..c6b5389b9e 100644
--- a/apps/web/lib/constant.ts
+++ b/apps/web/lib/constant.ts
@@ -1,2 +1,2 @@
-// API Host
-export const API_HOST = process.env.NEXT_PUBLIC_API_HOST || '';
+// API Host - direct request to backend (no proxy)
+export const API_HOST = process.env.NEXT_PUBLIC_API_URL || process.env.NEXT_PUBLIC_API_HOST || '';
diff --git a/apps/web/next.config.ts b/apps/web/next.config.ts
index 6d192d4295..dc354f3fea 100644
--- a/apps/web/next.config.ts
+++ b/apps/web/next.config.ts
@@ -2,16 +2,7 @@ import type { NextConfig } from "next";
const nextConfig: NextConfig = {
transpilePackages: ["@multica/ui", "@multica/store", "@multica/hooks", "@multica/sdk"],
- rewrites: async () => {
- const apiUrl = process.env.MULTICA_API_URL;
- if (!apiUrl) return [];
- return [
- {
- source: "/api/:path*",
- destination: `${apiUrl}/api/:path*`,
- },
- ];
- },
+ // Removed rewrites proxy - frontend requests API directly via NEXT_PUBLIC_API_URL
headers: async () => [
{
source: "/sw.js",