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

Method _addRoute

lib/server.js:523–536  ·  view source on GitHub ↗
(config, server)

Source from the content-addressed store, hash-verified

521 }
522
523 _addRoute(config, server) {
524
525 const route = new Route(config, server); // Do no use config beyond this point, use route members
526 const vhosts = [].concat(route.settings.vhost ?? '*');
527
528 for (const vhost of vhosts) {
529 const record = this._core.router.add({ method: route.method, path: route.path, vhost, analysis: route._analysis, id: route.settings.id }, route);
530 route.fingerprint = record.fingerprint;
531 route.params = record.params;
532 }
533
534 this.events.emit('route', route.public);
535 Cors.options(route.public, server);
536 }
537
538 rules(processor, options = {}) {
539

Callers 1

routeMethod · 0.80

Calls 2

emitMethod · 0.80
addMethod · 0.65

Tested by

no test coverage detected