(
path: string,
handler: (req: IncomingMessage, res: ServerResponse) => void,
)
| 60 | } |
| 61 | |
| 62 | addRoute( |
| 63 | path: string, |
| 64 | handler: (req: IncomingMessage, res: ServerResponse) => void, |
| 65 | ) { |
| 66 | if (this.#routes[path]) { |
| 67 | throw new Error(`Route ${path} was already setup.`); |
| 68 | } |
| 69 | this.#routes[path] = handler; |
| 70 | } |
| 71 | |
| 72 | #handle(req: IncomingMessage, res: ServerResponse) { |
| 73 | const url = req.url ?? ''; |
no outgoing calls
no test coverage detected