This is a basic of koa project structure, integrated with ts.
✓ koa v2
✓ Jest
✓ APIDOC
✓ Docker
✓ Eslint
✓ Husky
npm i -g koa-ts-cli
koats create myProject
# Choose koa-ts-base-template option.
cd myProject
npm install
cd myProject
npm run dev
npm run build
cd myProject/dist
npm run prod
cd myProject
npm install
npm run build
sudo docker build -t koa-ts-api-server .
sudo docker run -it --name koa-ts-api-server -p 8080:8080 koa-ts-api-server
or
cd myProject
./docker-build.sh
sudo docker run -it --name koa-ts-api-server -p 8080:8080 koa-ts-api-server
Unit test can be used to ensure the quality of the code.
cd myProject
npm run test
npm run apidoc