說明:
官網推薦: kong-dashboard,但對比界面高端程度和友好度,更推薦konga.
[一個坑]kong版本問題:我在安裝時目前kong最新版本已經到1.0.0, 對於konga和kong-dashboard還不支持,建議安裝低版本0.15如下; 具體表現查詢apis,舊版本:[ip]:8001/apis,新版:[ip]:8001/servicesnode
1. 安裝依賴mysql
sudo apt-get install nodejs npm sudo npm install -g gulp sudo npm install -g bower sudo npm install -g sails
2. 安裝git
git clone https://github.com/pantsel/konga.git cd konga npm install konga
3. 配置數據庫信息
目前支持數據庫: mysql, mongo, sqlserver, postgresgithub
cd config/ cp local_example.js local.js vi local.js models: { connection: process.env.DB_ADAPTER || 'localDiskDb', } # 改爲 models: { connection: process.env.DB_ADAPTER || 'mysql', // 這裏能夠用‘mysql’,‘mongo’,‘sqlserver’,‘postgres’ }
# 修改數據庫默認配置
vi konga/config/connections.jssql
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 || 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-deps npm install dotenv-extended npm install angular
啓動
#konga根目錄
npm start
訪問: http://127.0.0.1:1338
npm