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("Get Progress","Some progress in json"),group: "Getting Values");
svr.Add("/GetValue",async (e)=>{
await e.SendJsonAsync(new{num=value});
},new SwagmeDocumentation("Get Value","Value from SetValue?num=42 in json"),group: "Getting Values");
svr.Add("/SetValue",(e)=>{
string _va;
if(e.QueryParams.TryGetFirst("num",out _va))
{
int.TryParse(_va,out value);
}
},new SwagmeDocumentation("/SetValue?num=42","Set a number","Set an integer in program