MCPcopy Create free account
hub / github.com/gavv/httpexpect / FastHTTPHandler

Function FastHTTPHandler

_examples/fasthttp.go:12–24  ·  view source on GitHub ↗

FastHTTPHandler creates fasthttp.RequestHandler. Routes: GET /ping return "pong"

()

Source from the content-addressed store, hash-verified

10//
11// GET /ping return "pong"
12func FastHTTPHandler() fasthttp.RequestHandler {
13 return func(ctx *fasthttp.RequestCtx) {
14 switch string(ctx.Path()) {
15 case "/ping":
16 ctx.SetStatusCode(fasthttp.StatusOK)
17 ctx.SetContentType("text/plain")
18 ctx.SetBody([]byte("pong"))
19
20 default:
21 panic("unsupported path")
22 }
23 }
24}

Callers 1

fastHTTPTesterFunction · 0.85

Calls 1

PathMethod · 0.45

Tested by 1

fastHTTPTesterFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…