Skip to content

Instantly share code, notes, and snippets.

@Szer
Created May 20, 2021 07:53
Show Gist options
  • Save Szer/80d4365b3345493a2aa764330cf2d287 to your computer and use it in GitHub Desktop.
Save Szer/80d4365b3345493a2aa764330cf2d287 to your computer and use it in GitHub Desktop.
That's the minimum giraffe sample?
<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>
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