-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do you serve static files ? #22
Comments
The problem with serving content from feature folders and other areas of the project is that you'd need to put safeguards in place to make sure you don't send your source code and configuration files back to the client. |
Yes i agree. |
I have experience with large projects in production using feature folders. We have two types of static content:
So in the end, static content might live in feature folders, but never served from those folders. |
Thank you 😄 |
I think a feature folder is not complete with some static content, how do you serve it without copying to wwwroot ? I'm following this approach
https://docs.microsoft.com/en-us/aspnet/core/fundamentals/static-files?tabs=aspnetcore2x#serve-static-files
app.UseStaticFiles(new StaticFileOptions { FileProvider = new PhysicalFileProvider( Path.Combine(Directory.GetCurrentDirectory(), "MyStaticFiles")), RequestPath = "/StaticFiles" });
But it only works if the file system path starts with a different char than the request path or it will not allow to have any routing parameter in the request.
The text was updated successfully, but these errors were encountered: