服務器ubantu16.04下搭建自己的code-push-server服務器
服務端配置:
前期準備:
1、安裝nodejs,可以參考https://blog.csdn.net/well2049/article/details/79138045
2、安裝mysql,裝過的跳過
3、安裝code-push-server
1, 安裝和啟動code-push-server
$ git clone https://github.com/lisong/code-push-server.git
$ cd code-push-server
$ npm install
2,初始化資料庫
cd到code-push-server目錄
$ ./bin/db init --dbhost localhost --dbuser root --dbpassword #初始化mysql資料庫
初始化資料庫的時候本命令默認沒有密碼的,請前往code-push-server安裝目錄bin/db中修改
dbpassword 的值為你的mysql密碼
密碼修改之后在執行資料庫初始化命令就可以成功了,
3,修改config.js配置問題
打開組態檔
修改三個地方,新建一個目錄
a, 資料庫配置資訊,賬號密碼等
b, 修改downloadUrl 為本機ip地址
local: {
// Binary files storage dir, Do not use tmpdir and it's public download dir.
storageDir: "/Users/tablee/workspaces/storage",
// Binary files download host address which Code Push Server listen to. the files storage in storageDir.
downloadUrl: "http://192.168.0.7:3000/download",
// public static download spacename.
public: '/download'
},
c, 到https://www.grc.com/passwords.htm 這個地方,生成一個63 random alpha-numeric characters,填到tokenSecret欄位里面
jwt: {
// Recommended: 63 random alpha-numeric characters
// Generate using: https://www.grc.com/passwords.htm
tokenSecret: '6ix6a5Vw6knWnpZvlVhXqVGeQx86jGuaJb6YCdiVoyAbkA07IB59jgZKUcoizZI'
},
d,安裝組態檔中的目錄結構,到/Users目錄中建立如下檔案夾 /Users/tablee/workspaces/storage
4,啟動code-push-server服務器
cd到code-push-server目錄,執行一下命令
$ nohup ./bin/www &#啟動服務 瀏覽器中打開 http://127.0.0.1:3000 (也可以用本機ip訪問 http://192.168.0.7:3000)
到此服務器端到配置就完成了,
5,如果3000埠被占用,可以修改bin/www里面的埠即可,
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/205265.html
標籤:其他
上一篇:PCF8591模塊stm32相關代碼 進行IIC通信 四個ADC轉換模塊以及一個DAC轉換模塊
下一篇:namespace-C#命名空間
