abi
abi2y ago

Adding methods to Oak's Context?

I am trying to figure out how to configure my Oak application/router so that my routes can do things like ctx.customMethod(), could someone point me in the right direction? I can only really find how to customize the State, but that would only let me do ctx.state.customMethod() – is that how you're supposed to do it instead of what I had in mind?
1 Reply
abi
abiOP2y ago
The reason why I'd rather do ctx.customMethod() is because customMethod is supposed to do things with the current request and/or response, so it would seem more fitting in the Context type?

Did you find this page helpful?