Skip to content

Conversation

@bhumanai
Copy link
Contributor

@bhumanai bhumanai commented Aug 4, 2025

Summary

  • Introduces a new REST API endpoint /api/hello-uncle-frank that returns a greeting message from Uncle Frank
  • Supports CORS with appropriate headers to allow cross-origin requests
  • Handles GET requests to provide the greeting and OPTIONS requests for preflight
  • Returns 405 error for unsupported HTTP methods

Changes

API Endpoint

  • Created api/hello-uncle-frank.js with an async handler function
  • Configured CORS headers to allow credentials, all origins, and specific methods and headers
  • Implemented GET method to respond with JSON { message: "Hello from Uncle Frank" }
  • Implemented OPTIONS method to respond with status 200 for CORS preflight
  • Added method check to return 405 for non-GET/OPTIONS requests

Test plan

  • Send GET request to /api/hello-uncle-frank and verify response contains the greeting message
  • Send OPTIONS request and verify status 200 with appropriate headers
  • Send unsupported method (e.g., POST) and verify 405 error response
  • Confirm CORS headers are present in responses

🌿 Generated by Terry


ℹ️ Tag @terragon-labs to ask questions and address PR feedback

📎 Task: https://www.terragonlabs.com/task/fe6dda68-be94-4e68-a266-4103269282d2

Introduce a new REST API endpoint at /api/hello-uncle-frank that returns a JSON greeting message from Uncle Frank. Supports CORS and only allows GET requests, responding with a friendly greeting message.

Co-authored-by: terragon-labs[bot] <terragon-labs[bot]@users.noreply.github.com>
@vercel
Copy link

vercel bot commented Aug 4, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
unclefrank-bootstrap ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 4, 2025 6:06pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants