effect-http-routing

Create HTTP routes and JSON responses with schema-based validation in Node applications.

5|Updated Nov 18, 2025
One-click install
npx skills add https://github.com/mepuka/effect-ontology --skill effect-http-routing
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-http-routing
Source: https://github.com/mepuka/effect-ontology/tree/main/.claude/skills/effect-http-routing
Command: npx skills add https://github.com/mepuka/effect-ontology --skill effect-http-routing

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

HTTP server, routing, JSON responses and dependencies via layers. Use when wiring endpoints and services.

Core Features & Use Cases

  • Minimal HTTP handlers at routes
  • JSON responses with proper headers
  • Server startup with dependencies provided through Layers

Quick Start

Create a simple app with a GET route and serve it via a Node HTTP server layer.

Frequently Asked Questions about effect-http-routing

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up HTTP routing and JSON responses in a Node application?

HTTP routing creates endpoints that handle requests and return JSON responses. Use thin handler functions that decode inputs, validate them against schemas, call services, and encode responses back to clients. Wire these handlers to routes through a composed App layer that provisions dependencies.

What's the best way to structure handlers for HTTP endpoints?

Structure handlers as thin functions that perform three steps: decode and validate incoming request data using schema-based validation, call the appropriate service with validated inputs, and encode the service result into a JSON response with proper headers. This separation keeps routing logic clean.

How do I wire endpoints to services using layers?

Layers provide a composed App that holds dependencies and injects them into handlers. Define your routes with handlers that receive these dependencies, then pass the App to your HTTP server on startup. This decouples endpoints from service implementations and makes testing easier.

Can I use this approach to build small proxy endpoints?

Yes. Proxy endpoints follow the same handler pattern: decode the incoming request, forward it to an upstream service, and encode the response back as JSON. The layer-based dependency system lets you inject the upstream service client and manage its lifecycle.

What does schema-based validation do in HTTP handlers?

Schema-based validation checks that incoming request data matches expected structure and types before processing. Handlers use schemas to validate inputs early, returning structured errors to clients if validation fails. This prevents invalid data from reaching service logic.

Why use structured errors in HTTP responses?

Structured errors provide consistent, machine-readable error information to clients instead of raw stack traces. They let handlers return appropriate HTTP status codes and error details in JSON format, making client error handling predictable and enabling better debugging.