MCPcopy
hub / github.com/tinyhttp/tinyhttp / runServer

Function runServer

test_helpers/runServer.ts:3–9  ·  view source on GitHub ↗
(func: (req: Request, res: Response) => any)

Source from the content-addressed store, hash-verified

1import { createServer, IncomingMessage as Request, ServerResponse as Response } from 'http'
2
3export const runServer = (func: (req: Request, res: Response) => any) => {
4 const s = createServer((req, res) => {
5 func(req, res)
6 })
7
8 return s
9}

Callers 3

res.test.tsFile · 0.90
send.test.tsFile · 0.90
req.test.tsFile · 0.90

Calls 2

funcFunction · 0.85
createServerFunction · 0.50

Tested by

no test coverage detected