feat: initial development
This commit is contained in:
14
Demo/Demo.csproj
Normal file
14
Demo/Demo.csproj
Normal 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
15
Demo/Program.cs
Normal 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();
|
||||
Reference in New Issue
Block a user