moved *.cs to src/

This commit is contained in:
Timerix22 2023-12-18 12:41:07 +06:00
parent e37be491ba
commit 9cd059bad2
3 changed files with 222 additions and 219 deletions

View File

@ -1,7 +1,4 @@
using System; namespace Fluzm;
using DTLib.Dtsod;
namespace Fluzm;
public class Config public class Config
{ {

View File

@ -6,7 +6,7 @@ global using System.Threading;
global using System.Threading.Tasks; global using System.Threading.Tasks;
global using DTLib.Filesystem; global using DTLib.Filesystem;
global using DTLib.Extensions; global using DTLib.Extensions;
using DTLib.Dtsod; global using DTLib.Dtsod;
using DTLib.Logging; using DTLib.Logging;
namespace Fluzm; namespace Fluzm;

View File

@ -9,12 +9,17 @@ public class Router
public Router() public Router()
{ {
routes.Add("UwU", ctx => routes.Add("/aaa", ctx =>
{ {
var buffer = "<html><body><h1>UwU</h1></body></html>".ToBytes(); var buffer = """
<html>
<body>
<h1>aaa</h1>
</body>
</html>
""".ToBytes();
ctx.Response.ContentLength64 = buffer.Length; ctx.Response.ContentLength64 = buffer.Length;
ctx.Response.OutputStream.Write(buffer); ctx.Response.OutputStream.Write(buffer);
ctx.Response.OutputStream.Flush();
return 200; return 200;
}); });
} }
@ -84,8 +89,9 @@ public class Router
// reject all incorrect requests // reject all incorrect requests
else else
{ {
status = 501; status = 400;
ctx.Response.ContentLength64 = 0; ctx.Response.ContentLength64 = 0;
// ctx.Response.Headers.Set();
} }
ctx.Response.StatusCode = status; ctx.Response.StatusCode = status;
ctx.Response.OutputStream.Flush(); ctx.Response.OutputStream.Flush();