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;
using DTLib.Dtsod;
namespace Fluzm;
namespace Fluzm;
public class Config
{

View File

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

View File

@ -9,12 +9,17 @@ public class 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.OutputStream.Write(buffer);
ctx.Response.OutputStream.Flush();
return 200;
});
}
@ -84,8 +89,9 @@ public class Router
// reject all incorrect requests
else
{
status = 501;
status = 400;
ctx.Response.ContentLength64 = 0;
// ctx.Response.Headers.Set();
}
ctx.Response.StatusCode = status;
ctx.Response.OutputStream.Flush();