tesses.webserver/Tesses.WebServer.FileServer/Program.cs

29 lines
785 B
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using Tesses;
using Tesses.WebServer;
using Tesses.VirtualFilesystem;
using Tesses.VirtualFilesystem.Filesystems;
namespace Tesses.WebServer.ConsoleApp
{
class MainClass
{
public static void Main(string[] args)
{
var ip=System.Net.IPAddress.Any;
var lfs=new LocalFileSystem().GetSubdirFilesystem(Special.CurDir / "files");
StaticServer static_server = new StaticServer(lfs,true);
static_server.AllowUpload=true;
HttpServerListener s = new HttpServerListener(new System.Net.IPEndPoint(ip, 24240),static_server);
s.ListenAsync(System.Threading.CancellationToken.None).Wait();
}
}
}