Skip to content

Commit 889699d

Browse files
authored
Merge pull request #2 from wallymathieu/minimal-app
Minimal Giraffe App
2 parents eadc6c7 + 1e5db2b commit 889699d

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk.Web">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net7.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Compile Include="Program.fs" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<PackageReference Include="Giraffe" Version="6.2.*" />
14+
</ItemGroup>
15+
16+
</Project>

demo-apps/MinimalApp/Program.fs

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
open Microsoft.AspNetCore.Builder
2+
open Microsoft.Extensions.Hosting
3+
open Giraffe
4+
5+
let builder = WebApplication.CreateBuilder()
6+
builder.Services.AddGiraffe() |> ignore
7+
let app = builder.Build()
8+
let webApp =
9+
choose [
10+
route "/ping" >=> text "pong"
11+
route "/" >=> text "Hello World" ]
12+
13+
app.UseGiraffe(webApp)
14+
app.Run()

0 commit comments

Comments
 (0)