Skill
4
Agent
全部Skills
搜索
工具
中文
|
EN
开始探索
Loading...
首页
/
全部Skills
/
后端开发
/
fastify-best-practices
fastify-best-practices
原文:🇺🇸 英文
已翻译
Fastify开发综合最佳实践
68.7k
次下载
来源
mcollina/skills
添加于
2026-02-07
NPX安装
npx skill4agent add mcollina/skills fastify-best-practices
标签
翻译版元数据已加入标签,便于Agent理解和查找
Fastify开发
后端最佳实践
TypeScript集成
Fastify插件
Fastify测试
SKILL.md 内容(中文)
查看翻译对照 →
适用场景
在以下场景中可使用本技能:
使用Fastify开发后端应用
实现Fastify插件和路由处理器
获取Fastify架构与设计模式指导
在Fastify中结合TypeScript使用(剥离类型)
使用Fastify的inject方法实现测试
配置验证、序列化与错误处理
使用方法
阅读单个规则文件获取详细说明与代码示例:
rules/plugins.md
- 插件开发与封装
rules/routes.md
- 路由组织与处理器
rules/schemas.md
- JSON Schema验证
rules/error-handling.md
- 错误处理模式
rules/hooks.md
- 钩子与请求生命周期
rules/authentication.md
- 身份认证与授权
rules/testing.md
- 使用inject()进行测试
rules/performance.md
- 性能优化
rules/logging.md
- 结合Pino实现日志
rules/typescript.md
- TypeScript集成
rules/decorators.md
- 装饰器与扩展
rules/content-type.md
- 内容类型解析
rules/serialization.md
- 响应序列化
rules/cors-security.md
- CORS与安全头
rules/websockets.md
- WebSocket支持
rules/database.md
- 数据库集成模式
rules/configuration.md
- 应用配置
rules/deployment.md
- 生产环境部署
rules/http-proxy.md
- HTTP代理与reply.from()
核心原则
封装性
:Fastify的插件系统提供自动封装机制
优先定义Schema
:为验证和序列化定义Schema
性能优先
:Fastify针对速度进行了优化;请正确使用其功能
Async/await
:所有处理器和钩子均支持异步函数
最小依赖
:优先使用Fastify的内置功能和官方插件