-
Notifications
You must be signed in to change notification settings - Fork 0
feat: verify Cloudflare R2 setup #24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Deploying with
|
Status | Name | Latest Commit | Preview URL | Updated (UTC) |
---|---|---|---|---|
✅ Deployment successful! View logs |
ghostpaste | 37e09bf | Visit preview | Jun 05 2025, 03:21 PM |
- Created R2 test API endpoints for GET/POST/DELETE operations - Added R2Test component for UI testing - Documented R2 setup process and troubleshooting - Extended CloudflareEnv interface for GHOSTPASTE_BUCKET binding - Tested both text and binary data operations 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Added initOpenNextCloudflareForDev to next.config.ts - Updated R2_SETUP.md with development mode instructions - Fixes R2 access in npm run dev mode 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Convert Date objects to ISO strings for JSON serialization - Improve error message handling with proper type checking - Ensure all response data is serializable 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Remove metadata from response to avoid non-POJO serialization - Add debug logging to identify problematic objects - Use spread operator to ensure plain object for customMetadata 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Remove all complex objects and metadata from responses - Simplify to basic success/failure messages - Ensure all returned data is primitive types only - Add nested try-catch for better error isolation 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Use intersection type (CloudflareEnv & Env) for proper typing - Remove global interface extension as it's not needed - Maintain type safety for R2 bucket binding 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
- Run wrangler types with --env-interface CloudflareEnv flag - Remove manual type casting as CloudflareEnv now includes our bindings - Update npm script to always use the correct flag - Follow @opennextjs/cloudflare documentation best practices 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev> Co-Authored-By: Claude <claude@ghostpaste.dev>
…tion Co-Authored-By: Claude <claude@ghostpaste.dev>
1bf8ba8
to
473ca82
Compare
OpenNext requires edge runtime functions to be in separate files. All API routes run on edge runtime by default with @opennextjs/cloudflare. Co-Authored-By: Claude <claude@ghostpaste.dev>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Changes
/api/r2-test
endpoints for testing R2 operations (GET/POST/DELETE)R2Test
UI component for interactive testingdocs/R2_SETUP.md
Testing
ghostpaste-bucket
exists and is accessibleNotes
@opennextjs/cloudflare
for accessing Cloudflare bindingsnpm run preview
(notnpm run dev
)Closes #12
🤖 Generated with Claude Code