Add minimal test server to isolate Bun.serve networking issue

- Create simple test server on port 3001 to test Bun.serve functionality
- If test server works, issue is in complex application logic
- If test server hangs, issue is in Bun.serve or container networking
- This will isolate the root cause of the hanging requests

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
riz 2025-11-20 02:13:21 +00:00
parent 3c1346bd1a
commit cf461171e3
1 changed files with 20 additions and 0 deletions

View File

@ -82,6 +82,26 @@ export const createServer = async () => {
console.log(`[DEBUG] Starting Bun.serve on port ${g.port}...`); console.log(`[DEBUG] Starting Bun.serve on port ${g.port}...`);
// First try a minimal test server to isolate Bun.serve issues
console.log(`[DEBUG] Creating minimal test server first...`);
try {
const testServer = Bun.serve({
port: 3001, // Use different port for testing
hostname: "0.0.0.0",
development: false,
fetch(req) {
console.log(`[TEST] Minimal server request: ${req.method} ${req.url}`);
return new Response("Test server working!", {
status: 200,
headers: { "Content-Type": "text/plain" }
});
},
});
console.log(`[DEBUG] ✓ Test server listening on ${testServer.hostname}:${testServer.port}`);
} catch (testError) {
console.error(`[ERROR] Test server failed:`, testError);
}
try { try {
g.server = Bun.serve({ g.server = Bun.serve({
port: g.port, port: g.port,