CORS for Router or Controller #3657
Answered
by
provinzkraut
PabloExperimental
asked this question in
Q&A
-
Hi I'm creating an application using Litestar and I noticed that in the documentation is mentioned that is possible to add CORSMiddleware to Litestar app instance. Is it possible to possible to pass CORSConfig or CORSMiddleware to a Router or a Controller? Or do I have to create an "ad hoc" Middleware? |
Beta Was this translation helpful? Give feedback.
Answered by
provinzkraut
Aug 5, 2024
Replies: 1 comment 4 replies
-
Yes, it is. All layers (application, routers, controllers, handlers) accept |
Beta Was this translation helpful? Give feedback.
4 replies
Answer selected by
JacobCoffee
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes, it is. All layers (application, routers, controllers, handlers) accept
middleware
. You can read more about this here: https://docs.litestar.dev/latest/usage/applications.html#layered-architecture