Eomm / fastify-raw-body

Request raw body
MIT License
45 stars 10 forks source link

feat: support routes #13

Closed kkorus closed 2 years ago

kkorus commented 3 years ago

Hi, we could have an option to declare routes during plugin registration. That would help when using Fastify with NestJS where there is no option to set config on route like:

fastify.get('/en', { config: { rawBody: true } }, handler)

example usage:

  app.register(rawBody2, {
    field: 'rawBody',
    global: false,
    encoding: false,
    runFirst: true,
    routes: ['/api/user/v1', 'api/contact/v1'],
  });
phmz commented 3 years ago

Hello, I'm also interested in this feature, is there anything I can do to help? It would solve some of the issues we have with uploading files (fastify-multipart).

Eomm commented 3 years ago

I'm also interested in this feature, is there anything I can do to help?

Would you like to push some tests to complete this PR?

kkorus commented 3 years ago

Hi @Eomm, Yes, I will do this over the weekend.

Tam2 commented 2 years ago

I'm interested in this change too, currently using global: true to work around this issue with nestjs

Eomm commented 2 years ago

Would you like to push this feature over the line?

I'm more than happy to land it 👍🏼

Tam2 commented 2 years ago

Raised #14 which includes test cases