Building a resumable upload server with SwiftNIO
Support HTTP resumable upload protocol in SwiftNIO by translating resumable uploads to regular uploads.
Overview
Configure the sample code project
Before you run the sample code project:
In the
Package.swiftfile of an existing HTTP server project, add.package(path: "/path/to/swift-nio-resumable-upload")as one of the dependencies.Import
NIOResumableUploadin your SwiftNIO bootstrapping code.Create an upload context:
let uploadContext = HTTPResumableUploadContext(origin: "https://example.com").Wrap your HTTP server channel handler within
HTTPResumableUploadHandler.