Change license to GPL, add VFS, directory listing, upload support and a fileserver example
This commit is contained in:
parent
7f44596e22
commit
358fb10348
|
@ -0,0 +1,28 @@
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,18 @@
|
||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Tesses.WebServer.NetStandard\Tesses.WebServer.NetStandard.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Tesses.VirtualFilesystem.Local" Version="1.0.0" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
</Project>
|
Loading…
Reference in New Issue