MCPcopy
hub / github.com/hapijs/hapi / ext

Function ext

test/payload.js:433–447  ·  view source on GitHub ↗
(request, h)

Source from the content-addressed store, hash-verified

431
432 let data = null;
433 const ext = (request, h) => {
434
435 const chunks = [];
436 request.events.on('peek', (chunk, encoding) => {
437
438 chunks.push(chunk);
439 });
440
441 request.events.once('finish', () => {
442
443 data = Buffer.concat(chunks);
444 });
445
446 return h.continue;
447 };
448
449 const server = Hapi.server();
450 server.ext('onRequest', ext);

Callers

nothing calls this directly

Calls 2

onMethod · 0.65
onceMethod · 0.65

Tested by

no test coverage detected