Skip to content

Commit 2638fd9

Browse files
authored
Add Sisk (#8665)
* Add Sisk * upgrade sisk version
1 parent 0bd20bb commit 2638fd9

File tree

7 files changed

+153
-0
lines changed

7 files changed

+153
-0
lines changed

frameworks/CSharp/sisk/.gitignore

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
[Oo]bj/
2+
[Bb]in/
3+
TestResults/
4+
.nuget/
5+
*.sln
6+
*.sln.ide/
7+
_ReSharper.*/
8+
.idea/
9+
packages/
10+
artifacts/
11+
PublishProfiles/
12+
*.sln
13+
.vs/
14+
*.user
15+
*.suo
16+
*.cache
17+
*.docstates
18+
_ReSharper.*
19+
nuget.exe
20+
*net45.csproj
21+
*net451.csproj
22+
*k10.csproj
23+
*.psess
24+
*.vsp
25+
*.pidb
26+
*.userprefs
27+
*DS_Store
28+
*.ncrunchsolution
29+
*.*sdf
30+
*.ipch
31+
*.swp
32+
*~
33+
.build/
34+
.testPublish/
35+
launchSettings.json
36+
BenchmarkDotNet.Artifacts/
37+
BDN.Generated/
38+
binaries/
39+
global.json

frameworks/CSharp/sisk/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Sisk benchmark
2+
3+
See the [Sisk Framework website](https://sisk.project-principium.dev/) for more information.
4+
5+
## Infrastructure Software Versions
6+
7+
**Language**
8+
9+
* C# 11.0
10+
11+
**Platforms**
12+
13+
* .NET Core
14+
15+
## Paths & Source for Tests
16+
17+
* [Plaintext](sisk/Program.cs): "/plaintext"
18+
* [JSON](sisk/Program.cs): "/json"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"framework": "sisk",
3+
"tests": [{
4+
"default": {
5+
"plaintext_url": "/plaintext",
6+
"json_url": "/json",
7+
"port": 8080,
8+
"approach": "Realistic",
9+
"classification": "Fullstack",
10+
"database": "None",
11+
"framework": "Sisk",
12+
"language": "C#",
13+
"orm": "Raw",
14+
"platform": ".NET",
15+
"webserver": "Sisk",
16+
"os": "Linux",
17+
"database_os": "Linux",
18+
"display_name": "Sisk Framework"
19+
}
20+
}]
21+
}

frameworks/CSharp/sisk/config.toml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
[framework]
2+
name = "sisk"
3+
4+
[main]
5+
urls.plaintext = "/plaintext"
6+
urls.json = "/json"
7+
approach = "Realistic"
8+
classification = "Fullstack"
9+
database = "None"
10+
database_os = "Linux"
11+
os = "Linux"
12+
orm = "Raw"
13+
platform = ".NET"
14+
webserver = "Sisk"
15+
versus = "None"
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
2+
WORKDIR /source
3+
4+
# copy csproj and restore as distinct layers
5+
COPY sisk/*.csproj .
6+
RUN dotnet restore -r linux-musl-x64
7+
8+
# copy and publish app and libraries
9+
COPY sisk/ .
10+
RUN dotnet publish -c release -o /app -r linux-musl-x64
11+
12+
# final stage/image
13+
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS runtime
14+
WORKDIR /app
15+
COPY --from=build /app .
16+
17+
ENTRYPOINT ["dotnet", "./sisk.dll"]
18+
19+
EXPOSE 8080
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using Sisk.Core.Http;
2+
using Sisk.Core.Routing;
3+
using System.Net.Http.Json;
4+
5+
var app = HttpServer.CreateBuilder(host =>
6+
{
7+
host.UseListeningPort("http://+:8080/");
8+
});
9+
10+
app.Router.SetRoute(RouteMethod.Get, "/plaintext", PlainText);
11+
app.Router.SetRoute(RouteMethod.Get, "/json", Json);
12+
13+
app.Start();
14+
15+
static HttpResponse PlainText(HttpRequest request)
16+
{
17+
return new HttpResponse().WithContent("Hello, world!");
18+
}
19+
20+
static HttpResponse Json(HttpRequest request)
21+
{
22+
return new HttpResponse().WithContent(JsonContent.Create(new
23+
{
24+
message = "Hello, world!"
25+
}));
26+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net8.0</TargetFramework>
6+
<ImplicitUsings>enable</ImplicitUsings>
7+
<Nullable>enable</Nullable>
8+
<ServerGarbageCollection>true</ServerGarbageCollection>
9+
</PropertyGroup>
10+
11+
<ItemGroup>
12+
<PackageReference Include="Sisk.HttpServer" Version="0.16.0-rc-5" />
13+
</ItemGroup>
14+
15+
</Project>

0 commit comments

Comments
 (0)