Could you please tell me about the context of the extension? #1571
-
For example I
I want to manage the above two as state values. Number 1 is a DB setting for all handlers or middleware to share and use. In my opinion, number 1 should be server-wide state sharing, and number 2 should be state sharing specific to a specific request. Can axum Extension manage these two separately? What are the default settings? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes. Do |
Beta Was this translation helpful? Give feedback.
Yes. Do
router.layer(Extension(db))
for the global and from your auth middleware dorequest.extensions_mut().insert(...)
.