Tuesday, 22 March 2022

Static Files

 # Static files

1. By default, an asp.net core application will not serve static files
2. The default directory for static files is wwwroot and this directory must be in the root project folder
2. Middleware which serves static files
   // Add Static Files Middleware
    app.UseStaticFiles();
    
## Serving Default document

1. // Add Default Files Middleware
    app.UseDefaultFiles();    
2. The following are the default files which UseDefaultFiles middleware looks for
index.htm
index.html
default.htm
default.html

## Directory Browsing middleware

1. DirectoryBrowser middleware, enables directory browsing and allows users to see files within a specified directory.

No comments:

Post a Comment

Search This Blog

Creating your first "Alexa" Skill

Index What is Alexa What is Alexa Skill? Why is it required when Alexa already equipped with voice assistant? Dev...