![]() Not sure what I'm doing wrong, any help would be appreciated. On documentations looks like it should be fine: Here I should check the identity firstĪt the time being the code is just for understanding how a middleware works, the line with req.get_identity() always return a None, and that should be incorrect. use actix :: prelude :: use actixweb :: middleware. To achieve this we modify our app.rs file to the following. I have decided to go with static files served at the root level and move all app routs to /api prefix. ![]() Here is the server code: let server = HttpServer::new(move || ) We are going to change our routes a bit to fit our needs and separate the static file routes form our business logic ones. I thought I can do that with a middleware, but I have an issue recovering the Identity. We track the same default metrics and allow for adding user defined metrics. This middleware is heavily influenced by the work in sd2k/rocketprometheus. One of my needs is to authenticate a session token received from another service. Prometheus instrumentation for actix-web. I'm starting working with actix-web v2.0 for publishing a small web app at work.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |