-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
executable file
·41 lines (27 loc) · 1.04 KB
/
app.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
33
34
35
36
37
38
39
40
#!/usr/bin/env node
var express = require("express"),
app = express();
var indexRoutes = require("./routes/index");
app.set("view engine", "ejs");
app.set('views', __dirname+'/views');
app.use(express.static(__dirname + "/public"));
app.use("/", indexRoutes);
/*
const PORT = 5000;
const IP = '172.17.32.184';
app.listen(PORT, IP, function(){
console.log("Server Started!", IP+":"+PORT);
}); */
var fs = require('fs');
var http = require('http');
var https = require('https');
//var privateKey = fs.readFileSync(__dirname+'/ssl/csb_2019.key', 'utf8');
//var certificate = fs.readFileSync(__dirname+'/ssl/csb2.crt', 'utf8');
var privateKey = fs.readFileSync('/var/lib/ssl/csb_2019.key', 'utf8');
var certificate = fs.readFileSync('/var/lib/ssl/csb2.crt', 'utf8');
var credentials = {key: privateKey, cert: certificate};
// your express configuration here
var httpServer = http.createServer(app);
var httpsServer = https.createServer(credentials, app);
httpServer.listen(5000);
httpsServer.listen(443);