windows下运行konga及konga使用

windows下运行konga及konga使用

node运行

1.下载代码

git clone https://github.com/pantsel/konga.git
cd konga
npm i

2.配置环境变量

  • 复制.env_example到.env,并将以下配置信息填入到.env中主要修改配置DB_URI
PORT=1337
NODE_ENV=production
KONGA_HOOK_TIMEOUT=120000
DB_ADAPTER=postgres
DB_URI=postgresql://konga:[email protected]:5432/konga
KONGA_LOG_LEVEL=warn
TOKEN_SECRET=some_secret_token

3.运行代码

node ./bin/konga.js  prepare --adapter postgres --uri postgresql://localhost:5432/konga
npm run production

4.开启konga配置页面

  • 打开http://localhost:1337 注册账号
  • 连接kong,即是连接kong的admin_api的地址

docker运行

  • docker下安装比较简单,参考https://github.com/pantsel/konga#running-konga

  • docker下运行适合生产环境。

docker run --rm pantsel/konga:latest -c prepare -a postgres -u postgresql://konga:[email protected]:5432/konga

docker run -d --restart always -p 1337:1337 \
              --network kong-net \
              -e "TOKEN_SECRET=some_secret_token" \
              -e "DB_ADAPTER=postgres" \
              -e "DB_URI=postgresql://konga:[email protected]:5432/konga" \
              -e "NODE_ENV=production" \
              --name konga \
              pantsel/konga

猜你喜欢

转载自www.cnblogs.com/mbpframework/p/12891874.html