Skip to content

Commit

Permalink
[csharp] Add GenHTTP framework (#7984)
Browse files Browse the repository at this point in the history
* Add GenHTTP framework

* Convert /user to POST

* Switch to wildcard for minor version of package references
  • Loading branch information
Kaliumhexacyanoferrat authored Nov 25, 2024
1 parent 2ecdc7f commit 6ac4cae
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 0 deletions.
14 changes: 14 additions & 0 deletions csharp/genhttp/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using GenHTTP.Engine.Kestrel;
using GenHTTP.Modules.Functional;

var empty = "";

var app = Inline.Create()
.Get(() => empty)
.Get("/user/:id", (string id) => id)
.Post("/user", () => empty);

return await Host.Create()
.Handler(app)
.Port(3000)
.RunAsync();
3 changes: 3 additions & 0 deletions csharp/genhttp/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
framework:
github: Kaliumhexacyanoferrat/GenHTTP
version: 9.1
20 changes: 20 additions & 0 deletions csharp/genhttp/web.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>web</AssemblyName>
<OutputType>Exe</OutputType>

<ServerGarbageCollection>true</ServerGarbageCollection>
<TieredPGO>true</TieredPGO>

</PropertyGroup>

<ItemGroup>
<PackageReference Include="GenHTTP.Core.Kestrel" Version="9.1.*" />
<PackageReference Include="GenHTTP.Modules.Functional" Version="9.1.*" />
</ItemGroup>

</Project>
2 changes: 2 additions & 0 deletions reviewers.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,8 @@ csharp:
- jchannon
simplify.web:
- i4004
genhttp:
- Kaliumhexacyanoferrat
cpp:
drogon:
- an-tao
Expand Down

0 comments on commit 6ac4cae

Please sign in to comment.