NuGet package | Owin.Framework.StaticFiles |
GitHub source | OwinFramework.StaticFiles |
This middleware serves static files. This middleware works with any output cache middleware that you have installed to ensure that files are cached both on the server and also by the browser.
Static files are files shipped with your website that contain content that can be directly consumed by the browser. These are usually HTML, CSS, Javascript and image files, but can be any file that the browser can accept and process.
builder.Register(ninject.Get<OwinFramework.StaticFiles.StaticFilesMiddleware>()) .As("Static files") .ConfigureWith(config, "/owinFramework/middleware/staticFiles");
The configuration below is the configuration you will get by default if you do not provide a configuration for this middleware.
{ "owinFramework": { "middleware": { "staticFiles": { "documentationRootUrl": "/owin/staticFiles/config", "staticFilesRootUrl": "/assets", "rootDirectory": "~\\assets", "enabled": true, "analyticsEnabled": true, "includeSubFolders": true, "maximumFileSizeToCache": 32768, "maximumCacheTime": "01:00:00", "requiredPermission": "", "fileExtensions": [ { "extension": ".bmp", "mimeType": "image/bmp", "isText": false }, { "extension": ".jpg", "mimeType": "image/jpeg", "isText": false }, { "extension": ".png", "mimeType": "image/png", "isText": false }, { "extension": ".gif", "mimeType": "image/gif", "isText": false }, { "extension": ".html", "mimeType": "text/html", "isText": true }, { "extension": ".htm", "mimeType": "text/html", "isText": true }, { "extension": ".css", "mimeType": "text/css", "isText": true }, { "extension": ".txt", "mimeType": "text/plain", "isText": true }, { "extension": ".js", "mimeType": "application/javascript", "isText": true } ] } } } }