feat: initial development

This commit is contained in:
2023-07-27 01:47:59 +04:00
commit 85dc5981cd
30 changed files with 3075 additions and 0 deletions

14
Demo/Demo.csproj Normal file
View File

@@ -0,0 +1,14 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NaiveHttpServer\NaiveHttpServer.csproj" />
</ItemGroup>
</Project>

15
Demo/Program.cs Normal file
View File

@@ -0,0 +1,15 @@
using NaiveHttpServer;
var server = new Server("localhost", 2333);
server
.Use(Middlewares.Log)
.Use(Middlewares.ExceptionHandling)
.Use(Middlewares.StaticFile("/files", Environment.CurrentDirectory))
.Use(Middlewares.NotFound(documentUrl: "http://api.project.com/v1"));
server.Start();
Console.ReadKey();
server.Stop();