Node.js Chat -Anwendung mit Express, Socket.io, Redis und Mithril.
Siehe Flarum -Dokumentation: http://flarum.org/docs/api/
| Variable | Beschreibung | Typ | Standardwert |
|---|---|---|---|
| Env | Umfeld | optional | Entwicklung |
| HAFEN | Port App | optional | 5000 |
| Flarum_api_endpoint | API URL | erforderlich | keiner |
| Cookies_secret | Setzen Sie zufällige Cookies Secret | erforderlich | keiner |
| Session_secret | Setzen Sie zufällige Sitzungsgeheimnis | erforderlich | keiner |
| Redis_url | Redis -Instanz IP/Hostname | erforderlich | keiner |
| Piwik_id | Piwik id | optional | keiner |
| Piwik_url | Piwik -URL | optional | keiner |
Klonen Sie das Projekt und installieren Sie Abhängigkeiten:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add bower gulp pm2
yarn install
gulpErstellen.
ENV=production
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
Anwendung starten:
pm2 start --node-args= " --harmony " --name mondedie-chat app.jsÖffnen Sie App: http://127.0.0.1:5000/
Klonen Sie das Projekt und installieren Sie Abhängigkeiten:
git clone https://github.com/mondediefr/mondedie-chat.git
cd mondedie-chat
yarn global add -g bower gulp nodemon
yarn install
gulpErstellen.
ENV=development
COOKIES_SECRET=xxxxxxxxxxx
SESSION_SECRET=yyyyyyyyyyy
FLARUM_API_ENDPOINT=http://domain.tld/api/
Erstellen Sie mit diesem Inhalt ProcFile_dev -Datei in Projektroot:
web: nodemon --delay 1 --exec "node --harmony" app.js
worker: gulp watch
Anwendung starten:
foreman start -f Procfile_devÖffnen Sie App: http://127.0.0.1:5000/
docker pull mondedie/mondedie-chatSetzen Sie Umgebungsvariablen in docker-compose.yml
Wir haben einen Docker-compose.yml mit 3 Containern erstellt:
Erstellen Sie mit diesem Inhalt einen neuen 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" ;
}
}Laufen !
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Öffnen Sie App: http://mondedie-chat.dev:5000/
https://github.com/mondediefr/mondedie-chat/issues
Apache -Lizenzversion 2.0