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

Method route

lib/server.js:504–521  ·  view source on GitHub ↗
(options)

Source from the content-addressed store, hash-verified

502 }
503
504 route(options) {
505
506 Hoek.assert(typeof options === 'object', 'Invalid route options');
507
508 options = [].concat(options);
509 for (const config of options) {
510 if (Array.isArray(config.method)) {
511 for (const method of config.method) {
512 const settings = Object.assign({}, config); // Shallow cloned
513 settings.method = method;
514 this._addRoute(settings, this);
515 }
516 }
517 else {
518 this._addRoute(config, this);
519 }
520 }
521 }
522
523 _addRoute(config, server) {
524

Callers 15

_lookupMethod · 0.80
constructorMethod · 0.80
matchMethod · 0.80
cors.jsFile · 0.80
handler.jsFile · 0.80
headers.jsFile · 0.80
index.jsFile · 0.80
validation.jsFile · 0.80
state.jsFile · 0.80
payload.jsFile · 0.80
security.jsFile · 0.80
transmit.jsFile · 0.80

Calls 1

_addRouteMethod · 0.80

Tested by

no test coverage detected