This commit is contained in:
2017-02-23 07:52:30 +00:00
parent 2059fe78c2
commit b246e0f1ca
3 changed files with 9 additions and 10 deletions

7
app.js
View File

@@ -8,7 +8,6 @@ var fs = require('fs');
var zmrBot = require('./bot.js'); var zmrBot = require('./bot.js');
var app = express(); var app = express();
var port = process.env.PORT || 3000;
var sslPath = '/etc/letsencrypt/live/sao.twilightparadox.com/'; var sslPath = '/etc/letsencrypt/live/sao.twilightparadox.com/';
var options = { var options = {
@@ -32,8 +31,6 @@ app.use(function (err, req, res, next) {
var server = https.createServer(options, app); var server = https.createServer(options, app);
var io = require('socket.io').listen(server); var io = require('socket.io').listen(server);
server.listen(443); server.listen(443, function () {
console.log('start server. Listening for port 443')
app.listen(port, function () {
console.log('Slack bot listening on port ' + port);
}); });

View File

@@ -10,6 +10,7 @@
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"body-parser": "^1.16.1", "body-parser": "^1.16.1",
"express": "^4.14.1" "express": "^4.14.1",
"socket.io": "^1.7.3"
} }
} }

View File

@@ -2,11 +2,12 @@
Description=slackbot Description=slackbot
After=network.target After=network.target
[Service] [Service]
ExecStart=/var/www/slackbot/app.js ExecStart=/usr/bin/node /var/www/slackbot/app.js
Restart=always Restart=always
User=nobody RestartSec=10
Group=nobody #User=nobody
Environment=PATH=/usr/bin:/usr/local/bin #Group=nobody
#Environment=PATH=/usr/bin:/usr/local/bin
Environment=NODE_ENV=production Environment=NODE_ENV=production
WorkingDirectory=/var/www/slackbot WorkingDirectory=/var/www/slackbot
[Install] [Install]