Why doesn't the whole folder work at the root when using UseFileServer in OWIN?
I am creating a simple demo application where I want to use extensions StaticFile
. To set it up, I have the following code:
app.UseFileServer(new FileServerOptions()
{
FileSystem = new PhysicalFileSystem(@".\content"),
RequestPath = PathString.Empty,
EnableDefaultFiles = true
});
In a folder content
I have index.html
which is the server itself when I visit /
as expected, but the files are not served as expected.
content
index.html
app
lib
something.js
This is the file structure I have and I want to access something.js
by url /app/lib/something.js
, but with the code I have I now need to use /content/app/lib/something.js
which I don't want. Why index.html
does it get directly when I visit /
, but not when I go to /index.html
, and the same goes for the js file.
source to share
No one has answered this question yet
Check out similar questions: