Build OwlMeans server applications from immutable entrypoint protocol declarations. Use when starting a server, binding endpoint implementations, configuring services, or registering server entrypoints.
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Server App?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/owlmeans-server-app)
---
name: server-app
description: Build OwlMeans server applications from immutable entrypoint protocol declarations. Use when starting a server, binding endpoint implementations, configuring services, or registering server entrypoints.
---
# Server application entrypoints
**Install:** `bun add @owlmeans/server-app@^0.2.0-alpha.0`
Declare routes and request/response contracts in a shared package with `protocol()` or
`openProtocol()`. A server package supplies local implementations with `bind()` and `handlers()`;
it never changes a shared declaration by alias.
```ts
import { bind, entrypoints, handlers } from '@owlmeans/server-app'
import { projectProtocols } from 'project-common'
import { createProject } from './app/project.js'
const api = handlers<Context>()
export const serverBindings = [
...entrypoints,
bind(projectProtocols.base),
bind(projectProtocols.create, api.body(projectProtocols.create, createProject)),
]
```
`handlers<Context>().body`, `.params` and `.request` infer request sections and response values
from the declaration. Use `.request` for a transport-level handler that needs the complete request
boundary.
## Rules
- Keep `protocol()` declarations in the common package shared by callers and servers.
- Bind parent/group declarations as well as leaves; parents establish inherited paths and access.
- Use direct protocol references in `context.entrypoint(protocol)`; do not supply a caller-side
response generic.
- Model validation belongs in `contract()` with `typed()` or `schema()`, not in a wrapper around a
handler.
- `entrypoints` contains framework registrations. Add local entrypoints to a new array and register
that array during context initialization.
`holdApiPort`, `config`, `sservice`, `service`, `AppType` and the context bootstrap exports remain
available from this package for process wiring. A streamed upload route's handler reads its body with
`streamedBody(request)` (`StreamedBody`, refusals `StreamBodyTooLargeError` 413 and
`StreamBodyAbortedError` 400), re-exported from `@owlmeans/server-api` (`/server-api`).