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
Accessing shared state in handlers is demonstrated in https://github.com/actix/examples/blob/815e34f32ded77f73145fb0373a060b22636f689/state/src/main.rs
And with the way middleware worked previously, you could access shared state in the middleware as such: https://stackoverflow.com/questions/50428385/application-state-access-from-an-actix-web-application-middleware/50428541#50428541
But with the way middleware works now, as demonstrated in https://github.com/actix/examples/blob/09b0188ff99e872898793bd815382a4105219b77/middleware/src/redirect.rs. it is not apparent how one would access shared state from middleware.
Adding an example showing how to access shared state from middleware in 1.0.0-alpha.6 would be immensly helpful.
The text was updated successfully, but these errors were encountered:
Got an answer to this on Reddit from one of the people involved with actix. It's quite simple so no example for this is needed after all I think.
https://docs.rs/actix-web/1.0.0-alpha.6/actix_web/dev/struct.ServiceRequest.html#method.app_data
Sorry, something went wrong.
No branches or pull requests
Accessing shared state in handlers is demonstrated in https://github.com/actix/examples/blob/815e34f32ded77f73145fb0373a060b22636f689/state/src/main.rs
And with the way middleware worked previously, you could access shared state in the middleware as such: https://stackoverflow.com/questions/50428385/application-state-access-from-an-actix-web-application-middleware/50428541#50428541
But with the way middleware works now, as demonstrated in https://github.com/actix/examples/blob/09b0188ff99e872898793bd815382a4105219b77/middleware/src/redirect.rs. it is not apparent how one would access shared state from middleware.
Adding an example showing how to access shared state from middleware in 1.0.0-alpha.6 would be immensly helpful.
The text was updated successfully, but these errors were encountered: