1
0
Fork 0
mirror of https://github.com/zigzap/zap.git synced 2025-10-20 15:14:08 +00:00

Add C# version

This commit is contained in:
Leonardo Costa 2023-06-14 22:24:53 -04:00
parent ff8386cc65
commit 9009638982
5 changed files with 43 additions and 0 deletions

5
.gitignore vendored
View file

@ -6,6 +6,11 @@ tmp/
**/target/*
**/__pycache__/*
wrk/go/main
wrk/csharp/bin/
wrk/csharp/obj/
wrk/csharp/out/
scratch
**/.mypy_cache/*
docs/
.DS_Store
.vs/

8
wrk/csharp/Program.cs Normal file
View file

@ -0,0 +1,8 @@
var builder = WebApplication.CreateBuilder(args);
builder.Logging.ClearProviders();
var app = builder.Build();
app.MapGet("/", () => "Hello from C#");
app.Run();

View file

@ -0,0 +1,15 @@
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"profiles": {
"http": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "http://localhost:5026",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
}
}
}

8
wrk/csharp/csharp.csproj Normal file
View file

@ -0,0 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<PublishAot>true</PublishAot>
</PropertyGroup>
</Project>

View file

@ -58,6 +58,13 @@ if [ "$SUBJECT" = "axum" ] ; then
URL=http://127.0.0.1:3000
fi
if [ "$SUBJECT" = "csharp" ] ; then
cd wrk/csharp && dotnet publish csharp.csproj -o ./out
./out/csharp --urls "http://127.0.0.1:5026" &
PID=$!
URL=http://127.0.0.1:5026
fi
sleep 1
echo "========================================================================"
echo " $SUBJECT"