MCPcopy Index your code
hub / github.com/tinyhttp/tinyhttp / getRouteFromApp

Function getRouteFromApp

packages/app/src/request.ts:30–31  ·  view source on GitHub ↗
({ middleware }: App, h: Handler<Request, Response>)

Source from the content-addressed store, hash-verified

28}
29
30export const getRouteFromApp = ({ middleware }: App, h: Handler<Request, Response>) =>
31 middleware.find(({ handler }) => typeof handler === 'function' && handler.name === h.name)
32
33export const getProtocol = (req: Request): Protocol => {
34 const proto = req.connection.encrypted ? 'https' : 'http'

Callers 1

handleMethod · 0.90

Calls 1

findMethod · 0.80

Tested by

no test coverage detected