diff --git a/bench/servers/fastify.ts b/bench/servers/fastify.ts index 5239128..9cd8833 100644 --- a/bench/servers/fastify.ts +++ b/bench/servers/fastify.ts @@ -1,6 +1,6 @@ import Fastify from 'fastify'; -const app = Fastify({ logger: false }); +const app = Fastify({ logger: false, keepAliveTimeout: 5000 }); app.get('/hello', async () => ({ hello: 'world' })); app.get('/users/:id', async (req: any) => ({ id: req.params.id })); const hook = (n: number) => (req: any, _res: any, done: any) => { req[`s${n}`] = n; done(); }; @@ -14,6 +14,5 @@ app.post('/validate', { }); app.listen({ port: 0 }, (err, addr) => { if (err) { console.error(err); process.exit(1); } - (app.server as any).keepAliveTimeout = 5000; console.log(`READY ${Number(new URL(addr).port)}`); }); diff --git a/bench/servers/raw-http.ts b/bench/servers/raw-http.ts index c5d75ab..4b0bdd9 100644 --- a/bench/servers/raw-http.ts +++ b/bench/servers/raw-http.ts @@ -6,7 +6,6 @@ const server = http.createServer((req, res) => { if (req.method === 'GET' && url === '/hello') return send({ hello: 'world' }); if (req.method === 'GET' && url.startsWith('/users/')) return send({ id: url.slice('/users/'.length) }); if (req.method === 'GET' && url === '/pipeline') { const s: any = {}; [1, 2, 3].forEach((n) => (s[`s${n}`] = n)); return send({ hello: 'world', s3: s.s3 }); } - if (req.method === 'GET' && url === '/steps/0') return send({ hello: 'world' }); if (req.method === 'POST' && url === '/validate') { let raw = ''; req.on('data', (c) => (raw += c)); req.on('end', () => { try { const b = JSON.parse(raw); if (typeof b.email === 'string' && b.email.includes('@')) return send({ email: b.email }); return send({ error: 'invalid' }, 422); }