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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user