Skip to content

Add post endpoint#1

Open
princechavez wants to merge 3 commits intomainfrom
feature/add-post-endpoint
Open

Add post endpoint#1
princechavez wants to merge 3 commits intomainfrom
feature/add-post-endpoint

Conversation

@princechavez
Copy link

PR: Add /api/posts endpoint (initial implementation)

This PR adds a new API route at app/api/posts/route.ts to support basic post creation.
The endpoint accepts POST requests with userId, title, content, and optional labels.

Summary

  • New /api/posts route handler with POST and GET methods.
  • Simulates label processing by calling an external service (placeholder endpoint).
  • Returns a generated ID and echoes back the post content.
  • Simple logging added for debug purposes.

Testing Instructions

pnpm dev
curl -X POST http://localhost:3000/api/posts -H "content-type: application/json"   -d '{ "userId": "123", "title": "Hello", "content": "World", "labels": [{"name":"promo"}] }'

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.

1 participant