Created
May 20, 2021 07:53
-
-
Save Szer/80d4365b3345493a2aa764330cf2d287 to your computer and use it in GitHub Desktop.
That's the minimum giraffe sample?
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
<Project Sdk="Microsoft.NET.Sdk.Web"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net5.0</TargetFramework> | |
</PropertyGroup> | |
<ItemGroup> | |
<Compile Include="Program.fs" /> | |
</ItemGroup> | |
<ItemGroup> | |
<PackageReference Include="Giraffe" Version="5.0.0-rc-6" /> | |
</ItemGroup> | |
</Project> |
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
open Microsoft.AspNetCore | |
open Microsoft.AspNetCore.Hosting | |
open Giraffe | |
WebHost | |
.CreateDefaultBuilder() | |
.UseKestrel() | |
.Configure(fun a -> a.UseGiraffe(route "/" >=> POST >=> bindJson json)) | |
.ConfigureServices(fun s -> s.AddGiraffe() |> ignore) | |
.Build() | |
.Run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment