mondedie chat
v1.4.0
Node.js聊天應用程序使用Express,Socket.io,Redis和Mithril。
請參閱Flarum文檔:http://flarum.org/docs/api/
| 多變的 | 描述 | 類型 | 預設值 |
|---|---|---|---|
| env | 環境 | 選修的 | 發展 |
| 港口 | 端口應用程序 | 選修的 | 5000 |
| flarum_api_endpoint | API URL | 必需的 | 沒有任何 |
| cookies_secret | 設置隨機餅乾秘密 | 必需的 | 沒有任何 |
| session_secret | 設置隨機會話秘密 | 必需的 | 沒有任何 |
| redis_url | REDIS實例IP/主機名 | 必需的 | 沒有任何 |
| piwik_id | Piwik ID | 選修的 | 沒有任何 |
| piwik_url | Piwik URL | 選修的 | 沒有任何 |
克隆項目並安裝依賴項:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add bower gulp pm2
yarn install
gulp使用此內容創建.ENV文件:
ENV=production
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
開始應用程序:
pm2 start --node-args= " --harmony " --name mondedie-chat app.js打開應用:http://127.0.0.1:5000/
克隆項目並安裝依賴項:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add -g bower gulp nodemon
yarn install
gulp使用此內容創建.ENV文件:
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
使用此內容創建Procefile_dev文件:
web: nodemon --delay 1 --exec "node --harmony" app.js
worker: gulp watch
開始應用程序:
foreman start -f Procfile_dev打開應用:http://127.0.0.1:5000/
docker pull mondedie/mondedie-chatdocker-compose.yml中的設置環境變量
我們創建了一個docker-compose.yml,其中包括3個容器:
使用此內容創建一個新的nginx vhost:
# /mnt/docker/nginx/sites-enabled/chat.conf
server {
listen 8000 ;
server_name chat.domain.tld;
location / {
proxy_pass http://chat:5000;
# For websockets handshake to establish the upgraded connection
proxy_http_version 1.1 ;
proxy_set_header Upgrade $http_upgrade ;
proxy_set_header Connection "upgrade" ;
}
}跑步 !
docker-compose up -dsudo echo ' 127.0.0.1 mondedie-chat.dev ' >> /etc/hosts
echo ' export FLARUM_API_ENDPOINT="http://your-domain.tld/api/" ' >> ~ /.bash_profile cd /path/to/chat/mondedie-chat
npm install
docker-compose --file dev.yml up -d
gulp watch打開應用程序:http://mondedie-chat.dev:5000/
https://github.com/mondediefr/mondedie-chat/issues
Apache許可證版本2.0