diff --git a/scripts/generator-adapter/generators/app/templates/src/index.ts.ejs b/scripts/generator-adapter/generators/app/templates/src/index.ts.ejs index 3d1e3e5e..78ddae9d 100644 --- a/scripts/generator-adapter/generators/app/templates/src/index.ts.ejs +++ b/scripts/generator-adapter/generators/app/templates/src/index.ts.ejs @@ -16,6 +16,21 @@ export const adapter = new Adapter({ <% if (includeComments) { -%> // List of supported endpoints <% } -%><%= ' ' %> endpoints: [<%= endpointNames %>], +<% if (Object.values(endpoints).some(endpoint => endpoint.inputTransports.some(({ type }) => type === 'http'))) { -%> +<% if (includeComments) { -%> + // Rate limit otherwise we send requests as fast as possible without delay. + // You should adjust this based on what the data provider can tolerate and + // how fresh you need your data to be. The rate limit is global for all + // requests going through transport.dependencies.requester, which includes + // the requests prepared in HttpTransport.prepareRequests. +<% } -%><%= ' ' %> rateLimiting: { + tiers: { + default: { + rateLimit1m: 6, + }, + }, + }, +<% } -%> }) export const server = (): Promise => expose(adapter)