handlers

Community

Standardize API handlers and responses

Authorteexiii
Version1.0.0
Installs0

System Documentation

What problem does it solve?

Provides a consistent pattern for processing HTTP requests and producing standardized API responses, reducing duplicated error handling and inconsistent response shapes across a codebase.

Core Features & Use Cases

  • Unified Error Handling: Enforce wrapping handler logic with an errorHandler wrapper that catches JSON parsing issues, service errors, and Prisma-specific errors and maps them to proper HTTP statuses.
  • Request Parsing & Validation: Demonstrates reliable parsing of JSON bodies, route parameters, and query parameters, with examples for authentication checks and input validation for common CRUD operations.
  • Response Formatting & Mapping: Supplies success and failure helper patterns to return consistent payloads and shows mapper usage to transform service models into API responses; ideal for REST endpoints like user, baby, and activity resources.

Quick Start

Wrap your handler logic in the errorHandler wrapper, parse the request body or params as shown, perform service operations, and return results using the success or fail helpers.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: handlers
Download link: https://github.com/teexiii/boilerplate-rest-bun-for-noob/archive/main.zip#handlers

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.