From 6db4218ff6560bfa1c4d28b6ae9f4efcc4bdec1e Mon Sep 17 00:00:00 2001 From: "Builder.io" Date: Sat, 15 Nov 2025 05:20:43 +0000 Subject: [PATCH] Allow API routes in vercel.json rewrites cgen-80844d0e0e4842c6b4539fc30fbe3380 --- vercel.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vercel.json b/vercel.json index a2340233..4b2cfc92 100644 --- a/vercel.json +++ b/vercel.json @@ -2,7 +2,10 @@ "version": 2, "buildCommand": "npm ci && npm run build", "outputDirectory": "dist/spa", - "rewrites": [{ "source": "/(.*)", "destination": "/index.html" }], + "rewrites": [ + { "source": "/api/(.*)", "destination": "/api/$1" }, + { "source": "/(.*)", "destination": "/index.html" } + ], "headers": [ { "source": "/assets/(.*)",