Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Site.js
app
Commits
9566ac98
Verified
Commit
9566ac98
authored
Mar 07, 2019
by
Aral Balkan
Browse files
Globally-trusted certificates are working
parent
c65035f0
Changes
2
Hide whitespace changes
Inline
Side-by-side
bin/https-server.js
View file @
9566ac98
...
...
@@ -49,10 +49,12 @@ if (arguments.port !== undefined) {
// If an email is passed, use it.
let
email
=
undefined
if
(
arguments
.
emai
l
!==
undefined
)
{
email
=
arguments
.
emai
l
if
(
arguments
.
globa
l
!==
undefined
)
{
email
=
arguments
.
globa
l
}
console
.
log
(
'
email
'
,
email
)
if
(
!
fs
.
existsSync
(
pathToServe
))
{
console
.
log
(
` 🤔 Error: could not find path
${
pathToServe
}
\n`
)
process
.
exit
(
1
)
...
...
index.js
View file @
9566ac98
...
...
@@ -53,6 +53,7 @@ class HttpsServer {
// Can also be called as serve(pathToServe, port)
if
(
typeof
callback
===
'
number
'
)
{
email
=
port
port
=
callback
callback
=
null
}
...
...
@@ -78,7 +79,7 @@ class HttpsServer {
let
server
try
{
server
=
this
.
createServer
({
certificateType
,
email
},
app
).
listen
(
port
,
callback
)
server
=
this
.
createServer
({
email
},
app
).
listen
(
port
,
callback
)
}
catch
(
error
)
{
console
.
log
(
'
\n
Error: could not start server
'
,
error
)
throw
error
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment