0.1.1 • Published 2 years ago
koa2-web v0.1.1
Language : English | 简体中文
The best scaffolding of building Koa2
restful API with TypeScript
.
Features
- :bulb: TypeScript: support TypeScript
- :anchor: Commitlint:git commitlint
- :art: Prettier:prettier lint code
- :rocket: Exception:Global exception handling
- :airplane: Validator:Practical and efficient data validation usage
- :zap: MySQL:Support for MySQL database connections
- :fire: Redis:Support for Redis database connections
- :1234: Log:Log SQL and error logs
- :white_check_mark: Unit Test:Support unit test
- :memo: API Doc:API Doc UI
Usage
If you are not using the
pnpm
tool, usingnpm
andyarn
are the same to achieve the same performance.
install dependencies
$ pnpm install
start app
$ pnpm start or $ pnpm prod
lint code
$ pnpm lint
run test
$ pnpm test
Project Layout
├── .husky // hooks - here start pre-commit and commitlint
├── coverage // test output
├── build // build output
├── logs // log output
│ ├── error // error log
│ └── info // info log
├── src
│ ├── app.ts // koa start
│ ├── app // app modules
│ ├── config // env config
│ ├── typings // ts type
│ └── core // core mudules
│ ├── init.ts // core start
│ ├── global.ts // global var
│ ├── tool.ts // tool
│ ├── exception // global exception
│ ├── log // log modules
│ ├── mysql // mysql modules
│ ├── redis // redis modules
│ ├── swagger // api docs
│ └── validator // data validator
├── test // jest test.ts
├── .cz-config.js // commitlint tip
├── .editorconfig // lint config
├── .gitignore
├── .prettierignore
├── .prettierrc // prettier style config
├── commitlint.config.ts // commit-lint config
├── jest.config.js // jest test config
├── LICENSE
├── package.json
├── pnpm-lock.yaml
├── README.md
└── tsconfig.json
License
Copyright (c) 2022-present, Zeffon Wu