docs.nestjs.com icon indicating copy to clipboard operation
docs.nestjs.com copied to clipboard

docs(middleware): adding bodyParser customization documentation

Open sshevlyagin opened this issue 2 years ago • 6 comments

PR Checklist

Please check if your PR fulfills the following requirements:

  • [X] The commit message follows our guidelines: https://github.com/nestjs/docs.nestjs.com/blob/master/CONTRIBUTING.md

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?

Docs missing

Issue Number: https://github.com/nestjs/nest-cli/issues/1740

What is the new behavior?

Docs updated

Does this PR introduce a breaking change?

  • [ ] Yes
  • [X] No

Other information

sshevlyagin avatar Aug 13 '22 21:08 sshevlyagin

Updated and checked the preview, cool pipeline team!

sshevlyagin avatar Aug 14 '22 03:08 sshevlyagin

Thanks for taking a look @kamilmysliwiec. Two questions:

  • How would I register the bodyparser before calling NestFactory.create?
  • My main difficulty that I'm trying to address in the readme is I wanted to do what applying-middleware describes per route with bodyparser and that's what I'm trying to get across in the doc update. Is there a more accurate phrasing that would work?

sshevlyagin avatar Aug 17 '22 04:08 sshevlyagin

How would I register the bodyparser before calling NestFactory.create?

You can register it after calling NestFactory.create but before app.init()/app.listen()

kamilmysliwiec avatar Aug 17 '22 06:08 kamilmysliwiec

Got it, that's good to know but that wouldn't have solved my problem of wanting to use the MiddlewareConsumer pattern.

I can rework this PR as just warning under MiddlewareConsumer on using bodyparser as opposed to the more general advice. If that direction isn't acceptable let me know what would be.

sshevlyagin avatar Aug 22 '22 03:08 sshevlyagin

Sounds good @sshevlyagin!

kamilmysliwiec avatar Aug 23 '22 11:08 kamilmysliwiec

👋 @kamilmysliwiec ready for you when you have a chance

sshevlyagin avatar Sep 06 '22 16:09 sshevlyagin

@kamilmysliwiec @micalevisk friendly ping

sshevlyagin avatar Oct 02 '22 03:10 sshevlyagin

lgtm

kamilmysliwiec avatar Oct 03 '22 07:10 kamilmysliwiec