@ankhorage/ api (英语)
Ankhorage 的框架中立可执行的 API 运行时间 .
使用量
国 际
Ankhorage 包通过命令行界面曝光 ankh启用 ankh --help 来发现可用的软件包命令,或用 --help 用于特定软件包.
# Install the Ankhorage CLI
bun add --global @ankhorage/ankh
# Show usage information for api
ankh api --help
基本用途
@ankhorage/api 执行便携式的 REST API 内部定义,而不连接应用程序
处理器以快捷化, Next.js, 或另一个 HTTP 框架 。 框架软件包
移动边缘的响应, 而运行时间拥有操作的搜索和发送.
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;