Skip to content

Commit 563d443

Browse files
committed
Include rate limit for new adapters with http transport
1 parent d5d71c0 commit 563d443

File tree

1 file changed

+11
-0
lines changed
  • scripts/generator-adapter/generators/app/templates/src

1 file changed

+11
-0
lines changed

scripts/generator-adapter/generators/app/templates/src/index.ts.ejs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,17 @@ export const adapter = new Adapter({
1616
<% if (includeComments) { -%>
1717
// List of supported endpoints
1818
<% } -%><%= ' ' %> endpoints: [<%= endpointNames %>],
19+
<% if (Object.values(endpoints).some(endpoint => endpoint.inputTransports.some(({ type }) => type === 'http'))) { -%>
20+
<% if (includeComments) { -%>
21+
// Rate limit otherwise we send requests as fast as possible without delay
22+
<% } -%><%= ' ' %> rateLimiting: {
23+
tiers: {
24+
default: {
25+
rateLimit1m: 6,
26+
},
27+
},
28+
},
29+
<% } -%>
1930
})
2031

2132
export const server = (): Promise<ServerInstance | undefined> => expose(adapter)

0 commit comments

Comments
 (0)