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

Method match

lib/server.js:384–397  ·  view source on GitHub ↗
(method, path, host)

Source from the content-addressed store, hash-verified

382 }
383
384 match(method, path, host) {
385
386 Hoek.assert(method && typeof method === 'string', 'Invalid method:', method);
387 Hoek.assert(path && typeof path === 'string' && path[0] === '/', 'Invalid path:', path);
388 Hoek.assert(!host || typeof host === 'string', 'Invalid host:', host);
389
390 const match = this._core.router.route(method.toLowerCase(), path, host);
391 Hoek.assert(match !== this._core.router.specials.badRequest, 'Invalid path:', path);
392 if (match === this._core.router.specials.notFound) {
393 return null;
394 }
395
396 return match.route.public;
397 }
398
399 method(name, method, options = {}) {
400

Callers 11

cors.jsFile · 0.80
_addMethod · 0.80
config.jsFile · 0.80
contentTypeMethod · 0.80
headers.jsFile · 0.80
transmit.jsFile · 0.80
core.jsFile · 0.80
handlerFunction · 0.80
request.jsFile · 0.80
server.jsFile · 0.80
index.tsFile · 0.80

Calls 1

routeMethod · 0.80

Tested by

no test coverage detected