@owlmeans/server-route
v0.1.11
Published
Server-side route model factory and request matcher for the Fastify integration layer.
Readme
@owlmeans/server-route
Server-side route model factory and request matcher for the Fastify integration layer.
Overview
route()wraps aCommonRouteModelinto aServerRouteModelthat Fastify can register- Handles intermediate routes (parent routes without handlers), internal service routes, and path matching
- Used internally by
elevate()in@owlmeans/server-module - Re-exported as
broutefrom@owlmeans/server-app
Installation
bun add @owlmeans/server-routeUsage
Used automatically when calling elevate(). For explicit use:
import { route as broute } from '@owlmeans/server-route'
// or via server-app:
import { broute } from '@owlmeans/server-app'
// Create a server-ready route model
const serverRoute = broute(commonRoute, false)API
route<R>(commonRoute, intermediate, opts?): ServerRouteModel<R>
Creates a ServerRouteModel from a CommonRouteModel.
intermediate: true— creates a parent route that groups children but has no own handleropts.service— internal service routes that proxy to another service
ServerRouteModel<R>
Extends CommonRouteModel with:
isIntermediate(): booleanmatch(request): boolean— checks if this route handles the given requestresolve(context): Promise<RouteModel>— resolves the final route with service URL
isServerRouteModel(obj): boolean
Type guard to check if a module's route is already a ServerRouteModel.
Related Packages
@owlmeans/route—CommonRouteModelbase type@owlmeans/server-module— callsroute()internally when elevating@owlmeans/server-app— re-exportsrouteasbroute
Agent guidance
This package ships embedded Claude Code skills and GitHub Copilot instructions under
agent-meta/. After installing your @owlmeans/* packages, run the OwlMeans
agent-skills installer to place them into your project's native locations
(.claude/skills/ and .github/instructions/):
npx @owlmeans/agent-skillsThe embedded files are version-matched to this package release. Do not edit them directly — they are regenerated on each publish. To contribute guidance edits, open a PR against the source monorepo.
