* Adds an alias for a specific scraper's direct call route bypassing Task System. * @param {Function} scraper - The scraper function to add an alias for. * @param {string} endpoint - The alias path (e.g., '/hotels/search'). * @example * ApiConfig.addScraperAlias(hotelsSearchScrap
(scraper: Function, endpoint: string)
| 938 | * ApiConfig.addScraperAlias(hotelsSearchScraper, '/hotels/search'); |
| 939 | */ |
| 940 | static addScraperAlias(scraper: Function, endpoint: string): void { |
| 941 | if (!endpoint) return; |
| 942 | |
| 943 | if (!this.routeAliases.has(scraper)) { |
| 944 | this.routeAliases.set(scraper, [cleanBasePath(endpoint)]); |
| 945 | } else { |
| 946 | const aliasArray = this.routeAliases.get(scraper)!; |
| 947 | if (!aliasArray.includes(endpoint)) { |
| 948 | aliasArray.push(cleanBasePath(endpoint)); |
| 949 | } |
| 950 | } |
| 951 | } |
| 952 | |
| 953 | /** |
| 954 | * Adds custom routes to the API server using Fastify's routing system. |
nothing calls this directly
no test coverage detected