feat: replace docs placeholder with interactive test page across all entry points

- Replace router.ts handleDocs static placeholder with full interactive test page
- Replace worker.ts handleDocs with interactive test page
- Remove dead handleDocs() from index.ts (route already serves public/test-api.html)
- Update public/test-api.html with proper model defaults (deepseek-v4-flash-free)
- Add cache_control system prompt field to Anthropic test card
- Update handleIndex() to link to Interactive Test Page
- Remove handleDocs tests from index.test.ts
This commit is contained in:
MythEclipse
2026-06-20 21:44:15 +07:00
parent ccb1523692
commit 2f2aa08264
5 changed files with 295 additions and 336 deletions
-22
View File
@@ -11,7 +11,6 @@ import { test, expect, describe, beforeAll, afterAll } from "bun:test";
// Note: this will also start the Bun.serve() instance, which we allow.
import {
handleHealth,
handleDocs,
handleIndex,
getClientIP,
} from "./index";
@@ -37,27 +36,6 @@ describe("handleHealth", () => {
});
});
describe("handleDocs", () => {
test("should return 200 with HTML content", () => {
const response = handleDocs();
expect(response.status).toBe(200);
expect(response.headers.get("Content-Type")).toContain("text/html");
});
test("should include Edge Proxy Relay in the HTML", async () => {
const response = handleDocs();
const text = await response.text();
expect(text).toContain("Edge Proxy Relay");
expect(text).toContain("x-relay-target");
expect(text).toContain("WebSocket");
});
test("should include CORS header", () => {
const response = handleDocs();
expect(response.headers.get("Access-Control-Allow-Origin")).toBe("*");
});
});
describe("handleIndex", () => {
test("should return 200 with HTML content", () => {
const response = handleIndex();