mesa-fi-backlog/Adaptation/.kanbn/tasks/remove-static-file-controller.md
2023-10-20 12:31:59 -07:00

31 lines
756 B
Markdown

---
created: "2023-06-23T20:27:00.000Z"
updated: "2023-06-23T20:27:00.000Z"
assigned: ""
progress: 1
completed: "2023-05-27T00:00:00.000Z"
type: "note"
---
# 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;
}
}
```