-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
1 addition
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1 @@ | ||
# Beginor.Owin.StaticFile | ||
|
||
**Features:** | ||
|
||
- Simple static file middleware for owin, just has reference to Owin.dll, no reference to Microsoft.Owin.*; | ||
- Can handle most common static file types; | ||
- ETag header support (optional), use file's last modified time as etag value; | ||
- ETag custom provider support; | ||
|
||
**Usage:** | ||
|
||
Usage of this middleware is very simple: | ||
|
||
```c# | ||
// Use this static file middleware first is recomented | ||
app.UseStaticFile(new StaticFileMiddlewareOptions { | ||
RootDirectory = @"C:\inetpub\wwwroot", | ||
DefaultFile = "iisstart.htm", | ||
EnableETag = true, | ||
// when EnableETag is true, default ETag provider is LastWriteTimeETagProvider | ||
// you can write your owin provider | ||
// ETagProvider = new LastWriteTimeETagProvider(); | ||
MimeTypeProvider = new MimeTypeProvider() | ||
}); | ||
|
||
// Add other middleware/framework here, WebAPI/Nancy etc. | ||
app.UseWebApi(...); | ||
``` | ||
Project move to [Beginor.Owin](https://github.com/beginor/beginor.owin) |