Skip to content

Is using CORS with Falco currently possible? #97

Discussion options

You must be logged in to vote

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...
}

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@CameronThornton
Comment options

Answer selected by CameronThornton
Comment options

You must be logged in to vote
0 replies
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