Skip to content

Is there a straightforward way to add a header using middleware? #85

Answered by ndortega
ahjulstad asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @ahjulstad,

In your specific use case, I'd recommend setting your middleware function at the application level. Any middleware defined at the application level intercepts all incoming requests and outgoing responses.

serve(middleware=[addCORSheader])

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by ahjulstad
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants