Files
proxy-bun/api/test-api-content.ts
T

2 lines
14 KiB
TypeScript
Raw Normal View History

export default "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <title>Edge Proxy — API Test</title>\n <style>\n *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\n body { font-family: system-ui, -apple-system, sans-serif; background: #0d1117; color: #e1e4e8; padding: 1.5rem; }\n main { max-width: 960px; margin: 0 auto; }\n h1 { font-size: 1.5rem; color: #58a6ff; margin-bottom: 0.25rem; }\n .sub { color: #8b949e; margin-bottom: 1.5rem; font-size: 0.9rem; }\n\n .card { background: #161b22; border: 1px solid #30363d; border-radius: 8px; margin-bottom: 1rem; overflow: hidden; }\n .card-header { padding: 0.75rem 1rem; background: #1c2128; border-bottom: 1px solid #30363d; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 0.5rem; user-select: none; }\n .card-header:hover { background: #21262d; }\n .card-header .method { font-size: 0.7rem; padding: 1px 6px; border-radius: 3px; font-weight: 600; }\n .get { background: #1f6feb33; color: #58a6ff; }\n .post { background: #23863633; color: #3fb950; }\n .card-body { padding: 1rem; display: none; }\n .card.open .card-body { display: block; }\n .card-header .arrow { margin-left: auto; transition: transform .15s; }\n .card.open .arrow { transform: rotate(90deg); }\n\n label { display: block; font-size: 0.8rem; color: #8b949e; margin-bottom: 0.25rem; }\n input, textarea, select { width: 100%; background: #0d1117; border: 1px solid #30363d; border-radius: 4px; color: #e1e4e8; padding: 0.5rem 0.75rem; font-family: inherit; font-size: 0.9rem; margin-bottom: 0.75rem; }\n input:focus, textarea:focus { border-color: #58a6ff; outline: none; }\n textarea { min-height: 60px; resize: vertical; font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: 0.8rem; }\n textarea.code { min-height: 120px; }\n\n .row { display: flex; gap: 0.75rem; }\n .row > * { flex: 1; }\n\n .btn { background: #238636; color: #fff; border: none; border-radius: 6px; padding: 0.5rem 1.25rem; font-size: 0.85rem; cursor: pointer; font-weight: 500; }\n .btn:hover { background: #2ea043; }\n .btn:disabled { opacity: 0.5; cursor: not-allowed; }\n .btn-outline { background: transparent; border: 1px solid #30363d; color: #c9d1d9; }\n .btn-outline:hover { background: #21262d; border-color: #8b949e; }\n .btn-danger { background: #da3633; }\n .btn-danger:hover { background: #f85149; }\n\n .output { background: #0d1117; border: 1px solid #30363d; border-radius: 4px; padding: 0.75rem; margin-top: 0.5rem; }\n .output pre { font-family: 'SF Mono', 'Cascadia Code', monospace; font-size: 0.78rem; white-space: pre-wrap; word-break: break-all; max-height: 300px; overflow: auto; color: #c9d1d9; }\n .output .meta { font-size: 0.75rem; color: #8b949e; margin-bottom: 0.5rem; }\n .output .meta .status.ok { color: #3fb950; }\n .output .meta .status.err { color: #f85149; }\n\n .toast { position: fixed; bottom: 1.5rem; right: 1.5rem; background: #1c2128; border: 1px solid #30363d; border-radius: 6px; padding: 0.75rem 1rem; font-size: 0.85rem; display: none; z-index: 100; }\n </style>\n</head>\n<body>\n<main>\n <h1>Edge Proxy Relay — API Test</h1>\n <p class=\"sub\">Test all proxy endpoints from the browser</p>\n\n <!-- Global Auth -->\n <div class=\"card open\">\n <div class=\"card-header\">\n <span class=\"method get\">AUTH</span> API Key\n <span class=\"arrow\">▶</span>\n </div>\n <div class=\"card-body\">\n <label>API Key (default: <code>sk-dummy-key</code>)</label>\n <div class=\"row\">\n <input type=\"text\" id=\"apiKey\" value=\"sk-dummy-key\" />\n <input type=\"text\" id=\"baseUrl\" value=\"http://localhost:3000\" placeholder=\"http://localhost:3000\" />\n </div>\n </div>\n </div>\n\n <!-- Health -->\n <div class=\"card open\">\n <div class=\"card-header\" onclick=\"toggleCard(this)\">\n <span class=\"method