Created
September 30, 2017 07:27
-
-
Save nojaf/f4ce4216c68e7c6611a8afc79c6810fb to your computer and use it in GitHub Desktop.
Add cors to giraffe
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// <PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.0.0" /> | |
let configureApp (app : IApplicationBuilder) = | |
app.UseGiraffeErrorHandler errorHandler | |
app.UseCors(fun builder -> | |
builder.WithOrigins("http://localhost:8080").AllowAnyMethod().AllowAnyHeader() |> ignore | |
) |> ignore | |
let configureServices (services : IServiceCollection) = | |
services.AddCors() |> ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment