tesses-webserver-extras/README.md

44 lines
1.3 KiB
Markdown

# Tesses.WebServer.Extras
### EasyServer Stats
[![Tesses.WebServer.EasyServer Nuget](https://badgen.net/nuget/v/Tesses.WebServer.EasyServer)](https://www.nuget.org/packages/Tesses.WebServer.EasyServer/)
![Tesses.WebServer Downloads](https://badgen.net/nuget/dt/Tesses.WebServer.EasyServer)
### Swagme Stats
[![Tesses.WebServer Nuget](https://badgen.net/nuget/v/Tesses.WebServer.EasyServer)](https://www.nuget.org/packages/Tesses.WebServer.Swagme/)
![Tesses.WebServer Downloads](https://badgen.net/nuget/dt/Tesses.WebServer.Swagme)
<br>
# How to use Easy Server, ex for a static website
using Tesses.WebServer;
StaticServer server=new StaticServer("website");
server.StartServer(4000);
# How to use Swagme
using Tesses.WebServer;
using Tesses.WebServer.Swagme;
int value=0;
SwagmeServer svr=new SwagmeServer();
svr.AbsoluteUrl=true;
svr.Add("/Progress",async (e)=>{
await e.SendJsonAsync(new{Progress=50});
},new SwagmeDocumentation("Description","Extended Description"),group: "Getting Values");
RouteServer rsvr=new RouteServer();
rsvr.Add("/",(e)=>{
e.SendText("...html...");
});
MountableServer mount =new MountableServer(rsvr);
mount.Mount("/api/",svr);
mount.StartServer(4202);
The frontend for Swagme uses [Bootstrap](https://getbootstrap.com/)