www
868 Bytes
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
41
42
#!/usr/bin/env node
/**
* Module dependencies.
*/
var app = require("../app");
var https = require("https");
var path = require('path');
var fs = require("fs");
const domain = "도메인주소 입력";
const sslport = 3000;
const option = {
ca: fs.readFileSync("/etc/letsencrypt/live/" + domain + "/fullchain.pem"),
key: fs
.readFileSync(
path.resolve(
process.cwd(),
"/etc/letsencrypt/live/" + domain + "/privkey.pem"
),
"utf8"
)
.toString(),
cert: fs
.readFileSync(
path.resolve(
process.cwd(),
"/etc/letsencrypt/live/" + domain + "/cert.pem"
),
"utf8"
)
.toString(),
};
/**
* Create HTTPS server.
*/
https.createServer(option, app).listen(sslport, () => {
console.log(`[HTTPS] Server is started on port ${sslport}`);
});