fix: inline test-api.html as TypeScript string export for Vercel
Bun import of .html files returns HTMLBundle (not a string) in Vercel's serverless environment, and Bun.file() has no filesystem access there. Copy the HTML content into api/test-api-content.ts as an escaped string export, then import it in api/relay.ts — Bun bundler inlines it. Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+1
-4
@@ -29,10 +29,7 @@ import { createRateLimiter } from "../src/middleware/rate-limiter";
|
||||
import { logRelayEvent } from "../src/middleware/logger";
|
||||
import { handleChatCompletion, listModels } from "../src/lib/ai-proxy";
|
||||
import { handleAnthropicMessages } from "../src/lib/anthropic-proxy";
|
||||
|
||||
// Read test-api.html at module scope so Bun's bundler inlines the content
|
||||
// at build time (Vercel serverless has no filesystem at runtime).
|
||||
const testApiHtmlRaw = await Bun.file("public/test-api.html").text();
|
||||
import testApiHtmlRaw from "./test-api-content";
|
||||
|
||||
// ─── Configuration ──────────────────────────────────────────────────────────────
|
||||
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user