mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2026-04-03 20:08:21 +00:00
WIP
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
|
||||
using Esiur.Examples.StandaloneWebServerDemo;
|
||||
using Esiur.Net.HTTP;
|
||||
using Esiur.Net.Http;
|
||||
using Esiur.Net.Packets.Http;
|
||||
using Esiur.Protocol;
|
||||
using Esiur.Resource;
|
||||
using Esiur.Stores;
|
||||
@@ -22,10 +23,10 @@ internal class Program
|
||||
// Add your object to the store
|
||||
var service = await wh.Put("sys/demo", new Demo());
|
||||
|
||||
var http = await wh.Put<HTTPServer>("sys/http", new HTTPServer() { Port = 8888 });
|
||||
var http = await wh.Put<HttpServer>("sys/http", new HttpServer() { Port = 8888 });
|
||||
|
||||
|
||||
http.MapGet("{url}", (string url, HTTPConnection sender) =>
|
||||
http.MapGet("{url}", (string url, HttpConnection sender) =>
|
||||
{
|
||||
var fn = "Web/" + (sender.Request.Filename == "/" ? "/index.html" : sender.Request.Filename);
|
||||
|
||||
@@ -42,7 +43,7 @@ internal class Program
|
||||
}
|
||||
else
|
||||
{
|
||||
sender.Response.Number = Esiur.Net.Packets.HTTP.HTTPResponseCode.NotFound;
|
||||
sender.Response.Number = HttpResponseCode.NotFound;
|
||||
sender.Send("`" + fn + "` Not Found");
|
||||
sender.Close();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user