用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/HashLoad/horse --skill horse-minimal-api命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
基于 SOC 职业分类
正在显示 SKILL.md
| name | horse-minimal-api |
| description | Guide for building lightweight, low-boilerplate, and rapid HTTP services (Minimal APIs) in Horse. |
For focused microservices, mock APIs, or rapid prototyping, you can leverage Horse's lightweight routing and configuration DSL to build complete HTTP services in a single file with minimal boilerplate.
A Minimal API structures all route registrations, basic logic, and middleware imports directly within the main .dpr bootstrap file using inline anonymous procedures:
program MinimalAPI;
{$APPTYPE CONSOLE}
uses
System.SysUtils,
System.JSON,
Horse,
Horse.Jhonson;
begin
// 1. Fluent Middleware Configuration
THorse.Use(Jhonson);
// 2. Inline Route Mappings
THorse.Get('/ping',
procedure(Req: THorseRequest; Res: THorseResponse)
begin
Res.Send('pong');
end);
THorse.Get('/hello/:name',
procedure(Req: THorseRequest; Res: THorseResponse)
begin
Res.Send('Hello, ' + Req.Params.Field('name').AsString + '!');
end);
// 3. Fast JSON response
THorse.Get('/status',
procedure(Req: THorseRequest; Res: THorseResponse)
var
LStatus: TJSONObject;
begin
LStatus := TJSONObject.Create(TJSONPair.Create('status', 'online'));
Res.Send(LStatus); // Johnson takes ownership
end);
// 4. Port Listening
THorse.Listen(9000);
end.
Although Minimal APIs promote rapid development, follow these principles to avoid "spaghetti code":
THorse.UseRadixRouter; to ensure maximum matching speed if your API contains path parameters.Transition from a Minimal API to a structured MVC/Modular architecture when:
.dpr file.