scottoffen / grapevine

Fast, unopinionated, embeddable, minimalist web framework for .NET
https://scottoffen.github.io/grapevine/
MIT License
103 stars 16 forks source link

Custom middleware, adding JSON parser #116

Closed AgrYpn1a closed 2 years ago

AgrYpn1a commented 2 years ago

Hey, is it possible to add custom middleware? In my example, I need to parse the request body as JSON, so I don't wanna do it every time in each route, would be great if it can be included as a middleware and an extra string field where it contains a JSON that can be parsed from there, or even a generic parameter specifier that can be passed via attributes or something, so that the body is read as the specified type directly.

Thanks!