说明:
官网推荐: kong-dashboard,但对比界面高端程度和友好度,更推荐konga.[一个坑]kong版本问题:我在安装时目前kong最新版本已经到1.0.0, 对于konga和kong-dashboard还不支持,建议安装低版本0.15以下; 具体表现查询apis,旧版本:[ip]:8001/apis,新版:[ip]:8001/servicesnpm安装方式
1. 安装依赖
sudo apt-get install nodejs npmsudo npm install -g gulpsudo npm install -g bowersudo npm install -g sails
2. 安装
git clone https://github.com/pantsel/konga.gitcd konganpm install konga
3. 配置数据库信息
目前支持数据库: mysql, mongo, sqlserver, postgrescd config/cp local_example.js local.jsvi local.jsmodels: { connection: process.env.DB_ADAPTER || 'localDiskDb',}# 改成models: { connection: process.env.DB_ADAPTER || 'mysql', // 这里可以用‘mysql’,‘mongo’,‘sqlserver’,‘postgres’}
# 修改数据库默认配置
vi konga/config/connections.jsmysql: { adapter: 'sails-mysql', host: process.env.DB_HOST || 'localhost', port: process.env.DB_PORT || 3306, user: process.env.DB_USER || 'root', password: process.env.DB_PASSWORD || null, database: process.env.DB_DATABASE || 'konga_database'}# 改成mysql: { adapter: 'sails-mysql', host: process.env.DB_HOST || 'localhost', port: process.env.DB_PORT || 3306, user: process.env.DB_USER || 'root', password: process.env.DB_PASSWORD || 'root', database: process.env.DB_DATABASE || 'konga_database'}
安装依赖
npm run bower-depsnpm install dotenv-extendednpm install angular
启动
#konga根目录npm start访问: http://127.0.0.1:1338