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