https://github.com/wangdahoo/koa-rest-boilerplate
Koa restful boilerplate in typescript
https://github.com/wangdahoo/koa-rest-boilerplate
Last synced: about 1 year ago
JSON representation
Koa restful boilerplate in typescript
- Host: GitHub
- URL: https://github.com/wangdahoo/koa-rest-boilerplate
- Owner: wangdahoo
- Created: 2020-02-12T08:38:06.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T16:32:09.000Z (over 3 years ago)
- Last Synced: 2025-04-11T22:12:08.882Z (about 1 year ago)
- Language: TypeScript
- Homepage:
- Size: 458 KB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# koa-rest-boilerplate
## 准备
- [安装 docker](https://docs.docker.com/docker-for-mac/install/)
- [docker 镜像加速](https://www.daocloud.io/mirror)
## 开发
- 安装 mysql 并创建数据库
```bash
# 注意:如果本地 docker 需要 sudo 运行的话,前面也要加 sudo
# 安装 mysql
./make mysql
# 创建数据库
./make data
```
- 安装 redis
```bash
# 可选
./make redis
```
- 安装依赖
```bash
yarn
```
- 本地开发环境运行 web
```bash
yarn start
```
> web: [http://localhost:3000](http://localhost:3000)
- 本地开发环境运行 job
```bash
# 运行位于 app/job/demo 的 schedule job
JOB=demo yarn job
```
- migration
```bash
npm run typeorm migration:generate -- -n -f ormconfig.js
```
## 脚手架
```bash
npm i -g @wangdahoo/krb-cli
krb init
```