@minhvuong/pirate-storage-server
v0.1.1
Published
Fetch-standard route builder and authenticated upload handler for `@minhvuong/pirate-storage`.
Downloads
237
Readme
@minhvuong/pirate-storage-server
Fetch-standard route builder and authenticated upload handler for @minhvuong/pirate-storage.
The handler supports direct streamed uploads and resumable multipart sessions. Multipart parts are normal authenticated requests to the consumer's server or Worker; provider secrets are never sent to the browser.
Applications provide the journal implementation and persist completed receipts in
onUploadComplete using any database or ORM.
The journal stores temporary coordination metadata (file identity, provider session state, completed part locators/hashes, status, and expiry), never file bytes. During cancellation the handler marks the session aborted, waits for in-flight uploads, deletes late provider parts, and only then removes the journal record.
Concurrent requests for the same session part share one provider operation. This prevents a quick pause/resume from creating duplicate Discord attachment messages while the first request is still finishing server-side.
