Toggle navigation
Toggle navigation
This project
Loading...
Sign in
seungmin lee
/
OSS2020-2_Screensaver
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
이민호
2020-12-09 20:36:16 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
8b1a5305f3fa369b07b5cd3ee3fa71687de90598
8b1a5305
1 parent
b9375acb
delete http
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
21 deletions
screensaver/bin/www
screensaver/bin/www
View file @
8b1a530
...
...
@@ -6,34 +6,45 @@
var
app
=
require
(
"../app"
);
var
debug
=
require
(
"debug"
)(
"screensaver:server"
);
var
http
=
require
(
"http"
);
const
fs
=
require
(
'fs'
);
const
path
=
require
(
'path'
);
const
HTTPS
=
require
(
'https'
);
const
domain
=
"www.madcat.ga"
const
fs
=
require
(
"fs"
);
const
path
=
require
(
"path"
);
const
HTTPS
=
require
(
"https"
);
const
domain
=
"www.screensaver.ml"
;
const
sslport
=
23023
;
try
{
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
(),
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
(),
};
HTTPS
.
createServer
(
option
,
app
).
listen
(
sslport
,
()
=>
{
console
.
log
(
`[HTTPS] Server is started on port
${
sslport
}
`
);
});
}
catch
(
error
)
{
console
.
log
(
'[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다.'
);
console
.
log
(
"[HTTPS] HTTPS 오류가 발생하였습니다. HTTPS 서버는 실행되지 않습니다."
);
console
.
log
(
error
);
}
/**
* Get port from environment and store in Express.
*/
...
...
@@ -42,12 +53,6 @@ var port = normalizePort(process.env.PORT || "8080");
app
.
set
(
"port"
,
port
);
/**
* Create HTTP server.
*/
var
server
=
http
.
createServer
(
app
);
/**
* Listen on provided port, on all network interfaces.
*/
...
...
Please
register
or
login
to post a comment