Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsCommunityBlog
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

Back to skills

Server Route

ASecurity

How to use @owlmeans/server-route — wrapping a route model for server use, matching a request against a mounted path, intermediate vs leaf routes, and the ServiceRoute config shape. Auto-invoked when importing server-route helpers or writing a custom request matcher.

3 stars
0 votes
0 copies
0 views
Added 9/22/2026
developmenttypescriptapi

Works with

api

Security Analysis

A100/100

Scanned 9/22/2026

Install to Claude Code

$npx -y skills add owlmeans/common --skill server-route --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Server Route?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Server Route
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/owlmeans-server-route-common/badge)](https://www.skillsdirectory.com/skills/owlmeans-server-route-common)

More formats (shields.io, HTML) on the badges page.

Download Zip
Files
SKILL.md
---
name: server-route
description: How to use @owlmeans/server-route — wrapping a route model for server use, matching a request against a mounted path, intermediate vs leaf routes, and the ServiceRoute config shape. Auto-invoked when importing server-route helpers or writing a custom request matcher.
user-invocable: false
---
<!-- AUTO-GENERATED — do not edit. Regenerate via sync-agent-meta. -->

# @owlmeans/server-route

**Layer:** Server
**Install:** `"@owlmeans/server-route": "^0.1.18-rc.26"` in `dependencies`

## Key Exports

| Export | Description |
|--------|-------------|
| `route(model, intermediate, opts?)` | Wrap a route model for server use; with `opts.overrides` it also writes defaults into the declaration it wraps |
| `ServerRouteModel<R>` | `{ route, match(request, mount), isIntermediate() }` |
| `ServerRoute` | A route declaration plus the server extras |
| `ServiceRoute` | A service config entry plus the same extras — what `cfg.services` holds |
| `ServerRouteExtras` | `internalHost`, `internalPort`, `opened` — the fields `ServerRoute` and `ServiceRoute` share |
| `ServerRouteOptions<R>` | `{ overrides, pathField, match }` |
| `isServerRouteModel(obj)` | The `isIntermediate` marker test |
| `WILDCARD` (`*`), `DEFAULT_FIELD` (`url`) | Matching constants |

## Matching

`match(request, mount)` takes the **mounted path from the caller**: a declaration knows only the
segment it contributes, so composing the rest takes the context the entrypoint is attached to. A
server therefore always asks the entrypoint first and passes the answer in:

```typescript
entrypoint.route.match(request, entrypoint.mount())
```

The matcher behind it reads the request path from `DEFAULT_FIELD`, drops anything after `?`, then
walks the template segment by segment: `:params` are collected, `WILDCARD` swallows a segment (and
the rest of the path when it is the last one), and a literal mismatch or a path that runs out before
the template does is no match.

**A request path that outruns the template still matches** — the test is a prefix test, and it
answers the same for an intermediate model and for a leaf. So `match()` alone never tells a group
apart from an exact route; `isIntermediate()` is what does, and it is what the server reads to
decide whether the entrypoint runs in the `preHandler` chain or is bound as a route. In practice
only intermediates are ever asked to `match()`, because a bound leaf is dispatched by the HTTP
router rather than by this test.

Two escape hatches: `pathField` reads the path from a different request field, and `opts.match`
replaces the whole test with your own `(request, mount) => boolean`.

## Options

`overrides` fills in declaration fields that are **unset** — it is a defaults layer, never a rewrite,
so a value the declaration already states survives. It is applied **in place**: the wrapper shallow-
copies the model but not the declaration under it, so the keys `overrides` supplies are written onto
the caller's own `RouteModel.route`, and every other holder of that declaration sees them. Pass a
declaration you own, or none.

Nothing else here touches the declaration: where a route answers and which host it is reachable on
are computed on demand by the entrypoint against its context, not baked into the model.

## The server extras

`internalHost` / `internalPort` are the cluster-side address, but only the port of the pair reaches
the socket. `listen()` and `holdApiPort()` in `@owlmeans/server-api` read the app's own service entry
— `cfg.services[cfg.service]` — for `internalPort ?? port ?? PORT`, and take the bind host from
`opened` alone: `0.0.0.0` when it is `true`, `127.0.0.1` otherwise. `internalHost` is never read at
bind time. It is read in two places only — `sservice` in `@owlmeans/server-config` uses it as the
`host` fallback, and `@owlmeans/route` compares it against the resolved host when composing an
address, dropping TLS for a hop that stays inside the cluster.

`opened` is read only off a `ServiceRoute`. The same field on a per-route `ServerRoute` declaration
is inert; nothing reads it there.

## Usage

This package is typically used through `@owlmeans/server-app` and `@owlmeans/server-entrypoint`.
Import it directly only for custom routing.

```typescript
import { route as broute } from '@owlmeans/server-route'

const model = broute(routeModel, true, { pathField: 'url' })
```

## Depends On

- `@owlmeans/route`, `@owlmeans/context`

Attribution

owlmeansowlmeans
View sourceMore from owlmeans →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Browser Extension Developer

Use this skill when developing or maintaining browser extension code in the `browser/` directory, including Chrome/Firefox/Edge compatibility, content scripts, background scripts, or i18n updates.

284072 votes

Seo Optimizer

SEO optimization with keyword analysis, readability assessment, technical validation, content quality. Use for search rankings, blog posts, content audits, or encountering keyword density, readability scores, meta tags, schema markup errors.

2192 votes

Google Official Seo Guide

Official Google SEO guide covering search optimization, best practices, Search Console, crawling, indexing, and improving website search visibility based on official Google documentation

1862 votes

Tanstack Start

Build a full-stack TanStack Start app on Cloudflare Workers from scratch — SSR, file-based routing, server functions, D1+Drizzle, better-auth, Tailwind v4+shadcn/ui. Use whenever the user mentions TanStack Start, asks to scaffold a full-stack Cloudflare app with SSR, wants an SSR dashboard, or asks for a React 19 + Cloudflare Workers app with file-based routing and server functions — even if they don't name TanStack Start specifically. No template repo — Claude generates every file fresh per ...

9881 votes

Pentest

PTES-aligned adversarial security audit for backend, frontend, and mobile applications. Produces a CVSS-scored Hacker Report with verified PoCs and phased remediation.

5491 votes
View all in development →