some small changes

This commit is contained in:
2017-11-21 00:06:47 +07:00
parent 4aae137b08
commit e52a9727c3
4 changed files with 10 additions and 6 deletions

1
.env.example Normal file
View File

@@ -0,0 +1 @@
SSL_CERT_PATH=""

3
.gitignore vendored
View File

@@ -1 +1,2 @@
npm_modules node_modules
.env

3
app.js
View File

@@ -1,5 +1,6 @@
#!/usr/bin/env node #!/usr/bin/env node
require('dotenv').config();
var express = require('express'); var express = require('express');
var bodyParser = require('body-parser'); var bodyParser = require('body-parser');
var https = require('https'); var https = require('https');
@@ -8,7 +9,7 @@ var fs = require('fs');
var helloBot = require('./hello.js'); var helloBot = require('./hello.js');
var app = express(); var app = express();
var sslPath = '/etc/letsencrypt/live/sao.twilightparadox.com/'; var sslPath = process.env.SSL_CERT_PATH;
var options = { var options = {
key: fs.readFileSync(sslPath + 'privkey.pem'), key: fs.readFileSync(sslPath + 'privkey.pem'),

View File

@@ -1,17 +1,18 @@
{ {
"name": "zmr_slackbot", "name": "hello_slackbot",
"version": "0.0.1", "version": "0.0.1",
"description": "zaymer slackbot", "description": "hello slackbot",
"main": "app.js", "main": "app.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "dannc", "author": "dannc",
"license": "ISC", "license": "MIT",
"dependencies": { "dependencies": {
"body-parser": "^1.16.1", "body-parser": "^1.16.1",
"express": "^4.14.1", "express": "^4.14.1",
"requestify": "^0.2.5", "requestify": "^0.2.5",
"socket.io": "^1.7.3" "socket.io": "^1.7.3",
"dotenv": "^4.0.0"
} }
} }