Is using CORS with Falco currently possible? #97
Answered
by
pimbrouwers
CameronThornton
asked this question in
Q&A
-
Hey there, I'm just curious if it's currently possible to use CORS in a Falco project? If not, I'm curious if that's on the list? Thank you. |
Beta Was this translation helpful? Give feedback.
Answered by
pimbrouwers
Dec 19, 2022
Replies: 2 comments 1 reply
-
Sure is! Anything possible with ASPNET Core is possible with Falco. Here is an example using the host builder: webHost [||] {
// rest...
add_service (fun svc ->
svc.AddCors(fun o ->
o.AddPolicy(name = "PolicyName", configurePolicy = fun policy ->
policy.WithOrigins("https://example.com") |> ignore)))
use_middleware (fun app ->
app.UseCors("PolicyName"))
// rest...
} |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
CameronThornton
-
My pleasure! Thanks for reaching out!
…On Mon., Dec. 19, 2022, 3:50 p.m. Cap Coldman, ***@***.***> wrote:
Oh wow thanks so much. Can't believe I missed the add_service feature.
Thanks again!
—
Reply to this email directly, view it on GitHub
<#97 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABDB57JGLQ2CIS7LVBNWRMLWODDDDANCNFSM6AAAAAATDVFPXI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sure is! Anything possible with ASPNET Core is possible with Falco. Here is an example using the host builder: