faasjs-best-practices

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
Apply 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
    defineFunc
    in
    *.func.ts
    files
  • How plugin config from
    faas.yaml
    is auto-loaded
  • A complete endpoint example with typed params
查看defineFunc指南了解:
  • 何时在
    *.func.ts
    文件中使用
    defineFunc
  • 如何自动加载
    faas.yaml
    中的插件配置
  • 带类型参数的完整端点示例

Knex

Knex

See Knex rules for:
  • Configuring Knex via
    faas.yaml
    and using query-builder methods over
    knex.raw
查看Knex规则了解:
  • 如何通过
    faas.yaml
    配置Knex,以及优先使用查询构建器方法而非
    knex.raw

Related skills

相关技能

  • Unit testing: faasjs-unit-testing
  • 单元测试:faasjs-unit-testing