What problem does it solve?
This Skill unit addresses the challenges of implementing HTTP handlers that adhere to REST conventions, ensuring efficient request parsing, service invocation, and response formatting.
Core Features & Use Cases
- Request Parsing: Facilitates the conversion of HTTP requests into domain-specific types.
- Service Coordination: Enables handlers to delegate business logic to services, maintaining separation of concerns.
- Response Formatting: Automates the creation of JSON responses following RESTful API standards.
- Error Handling: Consistently maps domain errors to appropriate HTTP status codes.
- Use Case: For a web application, this Skill unit can be used to create a handler for user authentication, where it parses login requests, invokes the authentication service, and returns a JSON response with the appropriate status code.
Quick Start
Run the 'handlers-and-http' skill to generate a new HTTP handler for your application's login endpoint.