We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
因为遇到了每个request可能会用不同config的需求, 想请问是否可以动态改动中间件的config呢?
The text was updated successfully, but these errors were encountered:
hack了code Basic.prototype.done = function (handler) { var self = this; var payment = self.payment; return function (req, res, next) { if(req.wxpayconfig){ payment = new Payment(req.wxpayconfig); }
Basic.prototype.done = function (handler) { var self = this; var payment = self.payment; return function (req, res, next) { if(req.wxpayconfig){ payment = new Payment(req.wxpayconfig); }
是否更好方法 ?
Sorry, something went wrong.
middleware支持动态config: req.wxpayconfig supersheep#56
d44996f
可以在middleware外套一层,来根据不同的请求上下文来堆middleware传递不同的config
很强,我也遇到了这样的问题。 也是自己用hack的方式解决的。 但总觉得自己hack的方式很丑陋。
No branches or pull requests
因为遇到了每个request可能会用不同config的需求, 想请问是否可以动态改动中间件的config呢?
The text was updated successfully, but these errors were encountered: