-
I am using drogon C++ framework to develop a Restful server. I define two HttpController one for administration and another for applicative apis. I defined two listeners (two ports) in config file and I want to restrict access admin through one listener and access applicative api through the other. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Currently, all handlers are registered globally to every listener, with no capability for listener-specific handler registration. To address this limitation, I recommend implementing an AOP pre-routing advice or a filter to encapsulate the necessary logic. |
Beta Was this translation helpful? Give feedback.
-
@an-tao thank you for your confirmation so if we have to use filter, middleware, I share this code for everyone who wants to create quickly filters for this needs: Put your port in custom_config part of drogon config.json
|
Beta Was this translation helpful? Give feedback.
@an-tao thank you for your confirmation so if we have to use filter, middleware, I share this code for everyone who wants to create quickly filters for this needs:
Put your port in custom_config part of drogon config.json