Skip to content

Commit 6623429

Browse files
authored
Update README.md
1 parent da5ceae commit 6623429

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,13 @@ await server.appendRoute("GET /mock", to: .file(named: "mock.json"))
114114

115115
`FileHTTPHandler` will return `HTTP 404` if the file does not exist.
116116

117+
118+
[Range requests](https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Range_requests) are supported, responding with `HTTP 206 Partial Content` allowing for efficient streaming of media content:
119+
120+
```swift
121+
await server.appendRoute("GET,HEAD /jaws", to: .file(named: "jaws.m4v"))
122+
```
123+
117124
### DirectoryHTTPHandler
118125

119126
Requests can be routed to static files within a directory with `DirectoryHTTPHandler`:

0 commit comments

Comments
 (0)