unosquare / embedio

A tiny, cross-platform, module based web server for .NET
http://unosquare.github.io/embedio
Other
1.47k stars 176 forks source link

Multiple Static Folder #599

Open WillCrystian opened 2 months ago

WillCrystian commented 2 months ago

I need to create a project with multiple static folders, is there this resource in the library?

 var server = new EmbedIO.WebServer(o => o
     .WithUrlPrefix(url)
     .WithMode(HttpListenerMode.EmbedIO))
     .WithLocalSessionManager()
     .WithWebApi("/api", m => m
            .WithController(() => new ApiController())
            .WithController(() => new AnalyticsController()))               
      .WithStaticFolder("/", HtmlRootPath, true,  m => m
          .WithContentCaching(UseFileCache))
      .WithStaticFolder("/", HtmlRootPath + "\\analytics", true, m => m
          .WithContentCaching(UseFileCache))
      .WithModule(new ActionModule("/", HttpVerbs.Any, ctx => ctx.SendDataAsync(new { Message = "Error" })));

I'm trying to implement this code but without success.