Skip to content

feat: API Endpoint for Post HTML #156

Description

@fboucher

Parent PRD

#155

What to build

Create a new API endpoint GET /api/posts/{id}/html that fetches cleaned HTML from the cleanedposts blob container and returns it to the client. The endpoint should return the HTML content with Content-Type: text/html on success, or a 404 error with a clear message if the blob does not exist.

The endpoint follows the same auth and routing patterns as existing post endpoints in PostEndpoints.cs. The blob container name is cleanedposts and blob files are named {postId}.html.

Acceptance criteria

  • New route GET /api/posts/{postId}/html is registered in the API
  • Endpoint fetches the blob from the cleanedposts container using name {postId}.html
  • Returns 200 with Content-Type: text/html and the HTML body when the blob exists
  • Returns 404 with { "error": "Post HTML not found" } when the blob does not exist
  • Uses the same auth/authorization as existing post endpoints
  • Unit tests cover: blob exists, blob not found, blob service error

Blocked by

None - can start immediately

User stories addressed

  • User story 15: As a developer, I want a new API endpoint GET /api/posts/{id}/html that fetches from the cleanedposts blob container
  • User story 16: As a developer, I want the API endpoint to return a clear error when the HTML file doesn't exist

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestready-for-agentFully specified, ready for an AFK agent

    Projects

    Status
    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions