|
@ -11,6 +11,8 @@ const url = require('url'); |
|
|
|
|
|
|
|
|
var express = require("express"); |
|
|
var express = require("express"); |
|
|
|
|
|
|
|
|
|
|
|
const fs = require('fs'); |
|
|
|
|
|
|
|
|
var session = require('express-session'); |
|
|
var session = require('express-session'); |
|
|
|
|
|
|
|
|
const includes = require('./includes/includes.js'); |
|
|
const includes = require('./includes/includes.js'); |
|
@ -25,8 +27,11 @@ var app = express(); |
|
|
app.use(session({ secret: utils.getFileLine('../session_secret'), cookie: { maxAge: 6000000 }})); |
|
|
app.use(session({ secret: utils.getFileLine('../session_secret'), cookie: { maxAge: 6000000 }})); |
|
|
|
|
|
|
|
|
var privateKey = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/privkey.pem'); |
|
|
var privateKey = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/privkey.pem'); |
|
|
|
|
|
|
|
|
var certificate = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/certificate.pem'); |
|
|
var certificate = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/certificate.pem'); |
|
|
|
|
|
|
|
|
|
|
|
var port = 8080; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* Parses the request url and calls correct JS files |
|
|
* Parses the request url and calls correct JS files |
|
@ -79,4 +84,8 @@ app.use(function(request, res) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
http.createServer(app).listen(8080); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
https.createServer({ |
|
|
|
|
|
key: privateKey, |
|
|
|
|
|
cert: certificate |
|
|
|
|
|
}, app).listen(port); |