(req)
| 321 | const server = Bun.serve({ |
| 322 | port: PORT, |
| 323 | async fetch(req) { |
| 324 | const url = new URL(req.url) |
| 325 | |
| 326 | if (url.pathname.startsWith('/api/')) { |
| 327 | return handleAPI(req) |
| 328 | } |
| 329 | |
| 330 | // Serve index.html for all other routes |
| 331 | if (existsSync(HTML_PATH)) { |
| 332 | return new Response(readFileSync(HTML_PATH, 'utf-8'), { |
| 333 | headers: { 'Content-Type': 'text/html; charset=utf-8' }, |
| 334 | }) |
| 335 | } |
| 336 | |
| 337 | return new Response('Config UI not found', { status: 404 }) |
| 338 | }, |
| 339 | }) |
| 340 | |
| 341 | console.log(` |
no test coverage detected