HttpSelfHostServer

This commit is contained in:
2023-06-09 15:27:24 -07:00
parent afd4cf8efe
commit fb3c3ce699
31 changed files with 393 additions and 48 deletions

View File

@ -0,0 +1,30 @@
---
created: 2023-05-27T14:29:10.454Z
updated: 2023-05-27T14:32:05.873Z
assigned: ""
progress: 1
tags: []
completed: 2023-05-27T00:00:00.000Z
---
# Remove StaticFile Controller
```c#
_ = config.Routes.MapHttpRoute("Static", "{*url}", new { controller = "StaticFiles", action = "Index" });
public class StaticFilesController : ApiController
{
[HttpGet]
public HttpResponseMessage Index(string url)
{
if (string.IsNullOrWhiteSpace(url))
url = "index.html";
//var path = GeneratePath(url);
var response = new HttpResponseMessage();
//response.Content = new StringContent(File.ReadAllText(path));
//response.Content.Headers.ContentType = ContentType(url);
return response;
}
}
```