You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+7Lines changed: 7 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -114,6 +114,13 @@ await server.appendRoute("GET /mock", to: .file(named: "mock.json"))
114
114
115
115
`FileHTTPHandler` will return `HTTP 404` if the file does not exist.
116
116
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
+
117
124
### DirectoryHTTPHandler
118
125
119
126
Requests can be routed to static files within a directory with `DirectoryHTTPHandler`:
0 commit comments