prici-io / prici

manage plans and pricing for any SaaS application
https://prici.io
MIT License
37 stars 5 forks source link

add nest.js guard middleware #10

Closed davidmeirlevy closed 6 months ago

eladabramovich commented 6 months ago

Hey davidmeirlevy. I would like to help out with this issue, will it be ok if I submit a PR for it?

davidmeirlevy commented 6 months ago

Yes of course!

Tag me for any questions and help.

eladabramovich commented 6 months ago

@davidmeirlevy thanks. To make sure we are aligned, the Nest Guard should behave exactly like the express middleware, right?

Assuming that this is the case, I propose also to add an Interceptor to handle the logic of the finish event callback since there is no way to execute logic after the route handler runs in the Guard.

davidmeirlevy commented 6 months ago

First of all, feel free to join our brand new discord server: https://discord.gg/BxmsAQC2

To make sure we are aligned, the Nest Guard should behave exactly like the express middleware, right?

Yes.

Assuming that this is the case, I propose also to add an Interceptor to handle the logic of the finish event callback since there is no way to execute logic after the route handler runs in the Guard.

go for it. btw, my implementation of response.on('finish') is a native event of HTTP requests in node, so it should work on every type of webserver.