A robust file uploader for Cloudflare R2. Complements Render nicely.
If you want something simpler though, try https://github.com/Erisa/simple-r2-form.
[
{
"AllowedOrigins": ["https://[CHANGE ME TO YOUR WORKER CUSTOM DOMAIN]"],
"AllowedMethods": ["GET", "PUT"],
"MaxAgeSeconds": 3000,
"AllowedHeaders": [
"Authorization",
"x-amz-date",
"x-amz-content-sha256",
"content-type"
],
"ExposeHeaders": ["ETag", "Location"]
}
]
Object Read & Write permissions.git clone https://github.com/kotx/aster.gitpnpm iwrangler.toml to your liking (set bucket_name, PUBLIC_BUCKET_URL, R2_BUCKET_NAME)wrangler secret put [NAME] for R2_ACCESS_KEY, R2_SECRET_KEYpnpm run deployCF_API_TOKEN (with the Edit Cloudflare Workers template) and CF_ACCOUNT_ID in the repo settingswrangler.toml as needed (this will trigger the workflow)R2_ACCESS_KEY, R2_SECRET_KEY in the worker settings.Remember to add "http://127.0.0.1:8787", "http://localhost:8787" to the allowed origins CORS policy above.
Install deps:
pnpm i
Start development server:
pnpm dev
19 commits
TypeScript
97.7%
CSS
1.8%
A robust file uploader for Cloudflare R2. Complements Render nicely.
If you want something simpler though, try https://github.com/Erisa/simple-r2-form.
[
{
"AllowedOrigins": ["https://[CHANGE ME TO YOUR WORKER CUSTOM DOMAIN]"],
"AllowedMethods": ["GET", "PUT"],
"MaxAgeSeconds": 3000,
"AllowedHeaders": [
"Authorization",
"x-amz-date",
"x-amz-content-sha256",
"content-type"
],
"ExposeHeaders": ["ETag", "Location"]
}
]
Object Read & Write permissions.git clone https://github.com/kotx/aster.gitpnpm iwrangler.toml to your liking (set bucket_name, PUBLIC_BUCKET_URL, R2_BUCKET_NAME)wrangler secret put [NAME] for R2_ACCESS_KEY, R2_SECRET_KEYpnpm run deployCF_API_TOKEN (with the Edit Cloudflare Workers template) and CF_ACCOUNT_ID in the repo settingswrangler.toml as needed (this will trigger the workflow)R2_ACCESS_KEY, R2_SECRET_KEY in the worker settings.Remember to add "http://127.0.0.1:8787", "http://localhost:8787" to the allowed origins CORS policy above.
Install deps:
pnpm i
Start development server:
pnpm dev
19 commits
TypeScript
97.7%
CSS
1.8%