Skip to content

Latest commit

 

History

History
87 lines (64 loc) · 2.68 KB

README.en.md

File metadata and controls

87 lines (64 loc) · 2.68 KB

koa-sail-ts Build Status

README中文版

About

The seed of koa(2.x) with typescript

Usage

Quick start(development)

yarn
# use ts-node
yarn start

Test and lint

# first run `yarn start`
yarn test
# lint:check
yarn run eslint:check
# lint:fix
yarn run eslint:fix

Config

Refer to config-document

Build

yarn run build

Production

# if not pm2, please run `yarn global add pm2`
# first run `yarn run build`
yarn run prod

With docker

# build docker image
docker build -t <image-name>:<tag> .

For CI command

# this is an example
#!/bin/bash
echo 'start...'
docker stop koa-sail-ts
docker rm koa-sail-ts
docker rmi koa-sail-ts:0.1.0
docker build -t koa-sail-ts:0.1.0 .
docker run --name koa-sail-ts -p 8183:8181 -v /home/docker/koa-sail-ts/logs:/usr/src/app/logs -d koa-sail-ts:0.1.0
echo 'finished'
exit 0

Feature

Thanks

The project's birth and development is inseparable from koa, log4js, jsonwebtoken, typescript, and so on. For detail, refer to the part dependencies and devDependencies of package.json.

The project initially generated with koa-generator with javascript, and switch to typescript since 0.4.0. The project has undergone great change with the development of the project, but koa-generator is import for the birth of koa-sail-ts.

If you want to construct restful api by class, please refer to 0.8.x branch [The implementation refers to 如何使用koa2+es6/7打造高质量Restful API].

If you prefer style like express, please refer to 0.6.x branch.