hapi

Use when building @hapi/hapi servers, routes, plugins, auth schemes, HTTP APIs, request lifecycle, caching, stale-while-revalidate, server methods, views, startup sequences, or response marshalling.

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "hapi" with this command: npx skills add damusix/skills/damusix-skills-hapi

Hapi

Quick Start

const server = Hapi.server({ port: 3000 });
server.route({ method: 'GET', path: '/', handler: () => 'ok' });
await server.start();

Critical Rules

  1. Compose with decorations & methods - Expose services via decorations and reusable logic via methods
  2. Follow the lifecycle - 24-step request flow; see lifecycle overview
  3. Auth is three layers - scheme → strategy → default; see server auth
  4. Validate at the route - Use joi schemas on params, query, payload, headers; see validation
  5. Type routes with Refs - Use ServerRoute<Refs> pattern; see route scaffold

Workflow

  1. Create server - server overview for constructor options
  2. Register plugins - plugins and plugin structure
  3. Configure auth - auth schemes and route auth
  4. Define routes - route overview with handlers
  5. Add extensions - lifecycle hooks and pre-handlers

Key Patterns

TopicReference
Request/response objectsrequest, response
Response toolkit (h)toolkit
Sessions (yar)sessions
Caching & CORScache-cors, server cache, catbox-memory engine, catbox-fs engine, catbox-redis engine
Security headerssecurity
Payload parsingpayload
Decorations & methodsdecorations, methods
MIME types (mimos)mimos
Realms & plugin scopingrealm
Response marshallingmarshal pipeline
File serving (inert)overview, file handler, directory handler
Basic authenticationbasic auth
Error handling (Boom)boom errors
Error filtering (Bounce)bounce utility
WebSockets (nes)overview, subscriptions, client
Startup & shutdownstartup lifecycle
Eventsevents
Testing (server.inject)network
TypeScript overviewtypescript
TypeScript auth typingauth-scheme, type-author
JWT authenticationjwt overview, validate function, token API
TypeScript pluginsplugin-scaffold
Views & templatesvision overview, engines, context & layouts

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

htmx

No summary provided by upstream source.

Repository SourceNeeds Review
General

google-zx-scripting

No summary provided by upstream source.

Repository SourceNeeds Review
General

joi

No summary provided by upstream source.

Repository SourceNeeds Review
General

Find Skills for ClawHub

Search for and discover OpenClaw skills from ClawHub (the official skill registry). Activate when user asks about finding skills, installing skills, or wants...

Registry SourceRecently Updated
2771Profile unavailable