MCPcopy
hub / github.com/fastify/fastify / serverFactory

Function serverFactory

test/request-timeout.test.js:30–36  ·  view source on GitHub ↗
(handler, _)

Source from the content-addressed store, hash-verified

28 t.assert.strictEqual(httpsServer.requestTimeout, 1000)
29
30 const serverFactory = (handler, _) => {
31 const server = http.createServer((req, res) => {
32 handler(req, res)
33 })
34 server.requestTimeout = 5000
35 return server
36 }
37 const customServer = Fastify({ requestTimeout: 4000, serverFactory }).server
38 t.assert.strictEqual(customServer.requestTimeout, 5000)
39})

Callers

nothing calls this directly

Calls 1

handlerFunction · 0.70

Tested by

no test coverage detected