So I am playing around with Owin and Katana and I want to serve static files in my public folder.
I have a Content folder with stylesheets and a scripts folder.
My Startup:
public void Configuration(IAppBuilder app)
{
#if DEBUG
//when things go south
app.UseErrorPage();
#endif
// Remap '/' to '.\public\'.
// Turns on static files and public files.
app.UseFileServer(new FileServerOptions()
{
RequestPath = PathString.Empty,
FileSystem = new PhysicalFileSystem(@".\public"),
});
}
So if if I browse to localhost:8861/ I go the the index.html file in my public folder. That's ok. But I can also browse to my localhost:8861/Content/style.css which I want to block. Everything the user needs should be accessible in the public folder. All the rest should be blocked.
How can I achieve this?