import { Injectable } from '@nestjs/common' ; import { Route } from './interfaces/route.interface' ; @ Injectable ( ) export class ProxyRouteRegistry { private readonly routes = new Map < string , Route > ( ) ; public addRoute ( id , route ) { this . routes . set ( id , route ) ; } public addRoutes ( routes ) { routes . forEach ( route => { this . routes . set ( route . id , route ) ; } ) ; } public getRoute ( id ) { return this . routes . get ( id ) ; } }