Summary

Implements the requirements from #5 — the /files/download endpoint.

The download endpoints already existed in the codebase; this PR:

  • Documents both download forms in the README
  • Updates the API index page to surface the download endpoints
  • Adds a comprehensive dedicated test file with 8 tests covering all edge cases

Download Endpoints Implemented

Query parameter form

GET /files/download?file_path=/path/to/file.txt
GET /files/download?file_id=<uuid>

Path URL form

GET /files/download/path/to/file.txt

Both endpoints return files with:

  • Content-Disposition: attachment; filename="..." for browser download prompts
  • Content-Type: text/plain for text files
  • Content-Type: application/octet-stream + Content-Length for binary files
  • 404 when file is not found

Tests Added

tests/routes/files-download.test.ts with 8 tests:

  • ✅ Text file download via ?file_path=
  • ✅ Text file download via ?file_id=
  • ✅ Binary file download via ?file_path= (byte-level verification)
  • ✅ 404 for missing file (query param)
  • ✅ Text file download via path form (nested path)
  • ✅ Binary file download via path form (byte-level verification)
  • ✅ 404 for missing file (path form)
  • ✅ Single-segment top-level file via path form

Validation

bun test
37 pass, 0 fail

/claim #5

Claim

Total prize pool $10
Total paid $0
Status Pending
Submitted June 18, 2026
Last updated June 18, 2026

Contributors

XA

XananasX

@mehdiananas007

100%

Sponsors

TS

tscircuit

@tscircuit

$10