使用 TypeScript 构建 Koa2 项目的最佳实践

时间:2021-1-8 作者:admin

the best practice of building Koa2 with TypeScript. 中文

usage

  1. clone repo. git clone git@github.com:DhyanaChina/koa2-typescript-guide.git
  2. install dependencies. npm i
  3. configuring database information.

catalog

├── app
│   ├── controllers         ---  contoller
│   ├── helpers             ---  helper func
│   ├── jobs                ---  periodic task
│   ├── models              ---  database model
│   └── services            ---  adhesive controller and model
├── config
│   ├── environments        ---  environment variable
│   └── routers             ---  routing configuration file
└── test
    └── apis                ---  test cases

feature

  • separation configuration and business logic.

  • export scheme model and interface, keep the TypeScript style.

  • the minimalist rustful grammar, reduce the weight of the contoller.

  • test cases and more scientific lint configuration.

声明:本文内容由互联网用户自发贡献自行上传,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任。如果您发现有涉嫌版权的内容,欢迎进行举报,并提供相关证据,工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。