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

30 lines
853 B
C#
Raw Permalink 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;
static_server.RedirectToRootInsteadOfNotFound = true;
HttpServerListener s = new HttpServerListener(new System.Net.IPEndPoint(ip, 24240),static_server);
s.ListenAsync(System.Threading.CancellationToken.None).Wait();
}
}
}