Browse Source

Required fs for server.js

pull/4/head
jrtechs 6 years ago
parent
commit
fe47e1d8fe
1 changed files with 10 additions and 1 deletions
  1. +10
    -1
      server.js

+ 10
- 1
server.js View File

@ -11,6 +11,8 @@ const url = require('url');
var express = require("express");
const fs = require('fs');
var session = require('express-session');
const includes = require('./includes/includes.js');
@ -25,8 +27,11 @@ var app = express();
app.use(session({ secret: utils.getFileLine('../session_secret'), cookie: { maxAge: 6000000 }}));
var privateKey = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/privkey.pem');
var certificate = fs.readFileSync('/etc/letsencrypt/live/jrtechs.net/certificate.pem');
var port = 8080;
/**
* 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);

Loading…
Cancel
Save