faasjs-best-practices
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseApply these rules when writing or reviewing FaasJS code.
在编写或评审FaasJS代码时,请遵循以下规则。
File conventions
文件规范
See File conventions for:
- Project structure and special files
- Route segments and fallback (,
*.func.ts,index.func.ts)default.func.ts - Verb naming semantics and list endpoint conventions
查看文件规范了解:
- 项目结构与特殊文件
- 路由分段与回退文件(、
*.func.ts、index.func.ts)default.func.ts - 动词命名语义与列表端点规范
defineFunc
defineFunc
See defineFunc guide for:
- When to use in
defineFuncfiles*.func.ts - How plugin config from is auto-loaded
faas.yaml - A complete endpoint example with typed params
查看defineFunc指南了解:
- 何时在文件中使用
*.func.tsdefineFunc - 如何自动加载中的插件配置
faas.yaml - 带类型参数的完整端点示例
Knex
Knex
See Knex rules for:
- Configuring Knex via and using query-builder methods over
faas.yamlknex.raw
查看Knex规则了解:
- 如何通过配置Knex,以及优先使用查询构建器方法而非
faas.yamlknex.raw
Related skills
相关技能
- Unit testing: faasjs-unit-testing
- 单元测试:faasjs-unit-testing