Skip to content

Conversation

@lukaszniemkiewicz
Copy link
Contributor

@lukaszniemkiewicz lukaszniemkiewicz commented Oct 4, 2022

show example of enabling Throttle rate limiting behind proxies with express

the documentation was unsufficient to succesfuly implement the throttling since the external link to express suggested using 'app.set' method, wich by default throws 'property set does not exist` error

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • [x ] Docs
  • Other... Please describe:

What is the current behavior?

documentation for rate limiting behind proxies is insufficient to implement the throttling, since the external link to express suggested using app.set('trust proxy', 'loopback') method, which in NestJs throws property set does not exist error

Issue Number: N/A

What is the new behavior?

To successfully apply app.set('trust proxy', 'loopback') one needs to modify main.ts as shown in the commit
specifically changeing: const app = await NestFactory.create<NestExpressApplication>(AppModule);

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

… behind proxies with express

the documentation was unsufficient to succesfuly implement the throttling since the external link
to express suggested using 'app.set' method,  wich by default  throws
'property set does not exist` error
@micalevisk
Copy link
Member

can you remove the .swp file

I guess this is a good time to add the following to .gitignore as well :)

# Vim
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

Copy link
Member

@jmcdo29 jmcdo29 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor grammar change, otherwise looks good

Co-authored-by: Jackie McDoniel <me@jaymcdoniel.dev>
@kamilmysliwiec kamilmysliwiec merged commit d18f683 into nestjs:master Oct 18, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants