@ankhorage/api
v0.3.1
Published
Framework-neutral executable API runtime and transport contract for Ankhorage.
Maintainers
Readme
@ankhorage/api
Framework-neutral executable API runtime for Ankhorage.
Usage
CLI
Ankhorage packages expose their command-line interface through ankh. Use ankh --help to discover available package commands, or run a package command with --help for package-specific usage.
# Install the Ankhorage CLI
bun add --global @ankhorage/ankh
# Show usage information for api
ankh api --helpBasic Usage
@ankhorage/api executes portable internal REST API definitions without coupling application
handlers to Fastify, Next.js, or another HTTP framework. Framework packages adapt requests and
responses at the transport edge while this runtime owns operation lookup and dispatch.
const definition = {
id: "health-api",
origin: "internal",
protocol: "rest",
basePath: "/api",
endpoints: {
health: {
id: "health",
kind: "http",
operations: {
"health.read": {
id: "health.read",
protocol: "http",
intent: "read",
method: "GET",
path: "/health",
},
},
},
},
} satisfies InternalRestApiDefinition;