Function
start
(port: number, onRequest?: (req: IncomingMessage, res: ServerResponse) => void)
Source from the content-addressed store, hash-verified
| 23 | } |
| 24 | |
| 25 | export const start = (port: number, onRequest?: (req: IncomingMessage, res: ServerResponse) => void) => { |
| 26 | return new Promise<https.Server>((resolve) => { |
| 27 | const srv = create(onRequest) |
| 28 | |
| 29 | allowDestroy(srv) |
| 30 | |
| 31 | servers.push(srv) |
| 32 | |
| 33 | srv.listen(port, () => { |
| 34 | console.log(`server listening on port: ${port}`) |
| 35 | |
| 36 | resolve(srv) |
| 37 | }) |
| 38 | }) |
| 39 | } |
| 40 | |
| 41 | export const stop = async () => { |
| 42 | const stopServer = (srv: https.Server) => { |
Callers
nothing calls this directly
Tested by
no test coverage detected