Creates, configures, and debugs `@hapi/hapi` servers — implements routes, plugins, auth schemes, validation, caching, and request lifecycle hooks.
Use when building HTTP APIs, setting up stale-while-revalidate caching, registering server methods, configuring views, managing startup sequences, or troubleshooting response marshalling.
Similar popular skills
Related neighbors and high-traction skills in the same topics — useful to compare before installing.
Compose with decorations & methods - Expose services via [decorations](reference/server/decorations.md) and reusable logic via [methods](reference/server/methods.md)
Follow the lifecycle - 24-step request flow; see [lifecycle overview](reference/lifecycle/overview.md)
Auth is three layers - scheme → strategy → default; see [server auth](reference/server/auth.md)
Validate at the route - Use joi schemas on params, query, payload, headers; see [validation](reference/route/validation.md)
Type routes with Refs - Use ServerRoute<Refs> with ONLY the keys you need (Params, Query, Payload, etc.); omitted keys keep defaults. See [route scaffold](reference/typescript/route-scaffold.md)
Auth three-layer pattern:
server.auth.scheme('custom', schemeImpl); // 1. scheme (how to authenticate) server.auth.strategy('session', 'custom', options); // 2. strategy (configured instance) server.auth.default('session'); // 3. default (apply to all routes)
Scheme authenticate MUST return h.authenticated() with both credentials AND artifacts:
return h.authenticated({ credentials: { user: { id, name }, scope: ['user'] }, artifacts: { token } // always include artifacts for raw auth data });