I have been looking over the web and still no luck, hence why I am asking. I have a WEB API 4.6 project that will also be home to an angularjs2 application, I have set up to use static files like this:
var physicalFileSystem = new PhysicalFileSystem(@".\wwwroot\");
var options = new FileServerOptions
{
EnableDefaultFiles = true,
FileSystem = physicalFileSystem,
};
var contentTypes = new FileExtensionContentTypeProvider();
options.StaticFileOptions.FileSystem = physicalFileSystem;
options.StaticFileOptions.ServeUnknownFileTypes = true;
options.StaticFileOptions.ContentTypeProvider = contentTypes;
options.DefaultFilesOptions.DefaultFileNames = new[] { "index.html" };
options.EnableDirectoryBrowsing = true;
app.UseFileServer(options);
index.html is served, when index.html tries to fetch all the files(.css.js) a 404 error shows up in the console. I have enabled directory browsing and I see that the files are there.