Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

hackshen/koa

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

66 Commits

Repository files navigation

koa

koa写的接口,数据来源https://github.com/egotong/nows

运行环境:

centos:7
mysql:5.7 # 默认密码123456 ,具体配置文件在docker-compose.yml
node:latest

运行:

# clone 项目到本地
git clone https://github.com/hackshen/koa.git
# 在当前目录执行
docker-compose up -d
# 浏览器访问 127.0.0.1:3000
# 扩容多个koa服务(nginx需要重启)
docker-compose up --scale koa=4 -d

API:

/message

http://127.0.0.1:3000/message?table=rainbow&limit=3
可选参数:
 table: rainbow、chicken_soup (目前支持两个表 )
 limit: 1 (查询条数)
 type: text (默认返回一个对象)

/qrcode

http://127.0.0.1:3000/qrcode?data=Hello

/domain

http://127.0.0.1:3000/domain

ENV 配置

#NGINX http端口默认80
NG_HTTP=
#NGINX https端口默认443
NG_HTTPS=
#NGINX 线上和本地测试环境切换 默认dev
NG_ENV=
#NGINX 代理服务的名字 默认koa
APP_NAME=
#NGINX 代理服务的端口 默认3000
APP_PORT=
# MySQL 密码 默认123456
MYSQL_PWD=
# MySQL 端口 默认3306
MYSQL_PORT=
# MySQL 库名
DB_NAME=daily_msg

About

koa api

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /