(
response: http.ServerResponse,
status: number,
body: Readonly<Record<string, unknown>>,
headers: Readonly<Record<string, string>> = {},
)
| 49 | }> {} |
| 50 | |
| 51 | const writeJson = ( |
| 52 | response: http.ServerResponse, |
| 53 | status: number, |
| 54 | body: Readonly<Record<string, unknown>>, |
| 55 | headers: Readonly<Record<string, string>> = {}, |
| 56 | ) => { |
| 57 | response.writeHead(status, { |
| 58 | "content-type": "application/json", |
| 59 | ...headers, |
| 60 | }); |
| 61 | response.end(JSON.stringify(body)); |
| 62 | }; |
| 63 | |
| 64 | const writeText = (response: http.ServerResponse, status: number, body: string) => { |
| 65 | response.writeHead(status, { "content-type": "text/plain; charset=utf-8" }); |
no test coverage detected