heroku ssl attempt

This commit is contained in:
Ian Ramzy 2020-03-25 23:31:26 -04:00
parent 73b50708d3
commit 1d5a2091f6
3 changed files with 9 additions and 2 deletions

5
package-lock.json generated
View File

@ -538,6 +538,11 @@
"resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz",
"integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk="
},
"heroku-ssl-redirect": {
"version": "0.0.4",
"resolved": "https://registry.npmjs.org/heroku-ssl-redirect/-/heroku-ssl-redirect-0.0.4.tgz",
"integrity": "sha1-IboHB6pQO1CkEqCUar+qiO99CCw="
},
"http-errors": {
"version": "1.7.2",
"resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz",

View File

@ -12,6 +12,7 @@
"dependencies": {
"dotenv": "^8.1.0",
"express": "^4.17.1",
"heroku-ssl-redirect": "0.0.4",
"socket.io": "^2.2.0",
"twilio": "^3.34.0"
}

View File

@ -1,5 +1,5 @@
require('dotenv').config();
var sslRedirect = require('heroku-ssl-redirect');
var twilio = require('twilio')(process.env.TWILIO_ACCOUNT_SID, process.env.TWILIO_AUTH_TOKEN);
var express = require('express');
var app = express();
@ -8,7 +8,8 @@ var io = require('socket.io')(http);
var path = require('path');
var public = path.join(__dirname, 'public');
// enable ssl redirect
app.use(sslRedirect());
app.use(express.static('public'));