The fs function provides "file system" style access to the file content stored in the Bloom Library S3 buckets, but hiding the fact in the URL that Amazon S3 storage is used.
/fs/{bucket}/{bookid}/{part1}/{part2?}/{part3?}
Parameters:
bucket: One of "upload", "dev-upload", "harvest", "dev-harvest"bookid: The database ID of the book in Parse Serverpart1,part2,part3: Optional path components within the book's directory
# Development harvest thumbnail
curl http://127.0.0.1:54321/functions/v1/fs/dev-harvest/U4KS7uOBBC/thumbnails/thumbnail-256.png
# Production book file
curl http://127.0.0.1:54321/functions/v1/fs/upload/XmdUIm6vEa/Hornbill+and+Cassowary.bloomd
# Audio file
curl http://127.0.0.1:54321/functions/v1/fs/dev-upload/fids0TH3Vy/audio/a96c71f9-c066-4e73-927f-9f8dcafee65c.mp3Required in .env.local for local development:
BLOOM_PARSE_APP_ID_PROD=your_production_parse_app_id
BLOOM_PARSE_APP_ID_DEV=your_development_parse_app_id
BLOOM_PARSE_APP_ID_UNIT_TEST=your_unittest_parse_app_idThe fs function is publicly accessible and does not require JWT authentication. This is configured in config.toml.
# Start all Supabase services
pnpm dev
# Or start with debugging enabled
pnpm dev:debug
# Test the function
curl -I "http://127.0.0.1:54321/functions/v1/fs/dev-harvest/U4KS7uOBBC/thumbnails/thumbnail-256.png"# Deploy all functions ("run" needed: deploy is a pnpm built-in command)
pnpm run deploy
# Deploy only fs function
pnpm deploy:fs
# Deploy to specific project
pnpm run deploy --project-ref your-project-id