| 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 | |