-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathserver.js
32 lines (26 loc) · 890 Bytes
/
server.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use strict";
require('dotenv').config()
var b32 = require("hi-base32");
console.log(process.argv.length)
const out = require('./relay.js')().serve(process.env.KEY, 2080, 2443, "127.0.0.1");
console.log('listening', b32.encode(out).replace('====','').toLowerCase());
console.log('hex', out);
var app = require("./app.js");
require("greenlock-express")
.init({
packageRoot: __dirname,
configDir: "./greenlock.d",
maintainerEmail: "[email protected]",
cluster: false
})
.ready(httpsWorker);
function httpsWorker(glx) {
var httpsServer = glx.httpsServer(null, app);
httpsServer.listen(2443, "0.0.0.0", function() {
console.info("Listening on ", httpsServer.address());
});
var httpServer = glx.httpServer();
httpServer.listen(2080, "0.0.0.0", function() {
console.info("Listening on ", httpServer.address());
});
}