(status, obj)
| 125 | hub = http.createServer(async (req, res) => { |
| 126 | const body = await readBody(req); |
| 127 | const respond = (status, obj) => { |
| 128 | res.writeHead(status, { 'Content-Type': 'application/json' }); |
| 129 | res.end(JSON.stringify(obj)); |
| 130 | }; |
| 131 | if (req.url === '/a2a/hello') { |
| 132 | const err = hubValidate(body, ['hello']); |
| 133 | if (err) return respond(400, { error: err }); |