refactor(entrypoint): move HTTP/S message to javascript

This commit is contained in:
Asif Bacchus 2021-07-23 23:45:58 -06:00
parent e83dce3304
commit 81cfe975b4
2 changed files with 5 additions and 3 deletions

View File

@ -99,7 +99,6 @@ if [ "$doServer" -eq 1 ]; then
# https pre-flight check # https pre-flight check
if [ "$enableHTTPS" = "true" ]; then if [ "$enableHTTPS" = "true" ]; then
printf "[SSL/TLS mode enabled]\n"
certStatus="$(certificateCheckExist)" certStatus="$(certificateCheckExist)"
case "$certStatus" in case "$certStatus" in
noexist) noexist)
@ -120,8 +119,6 @@ if [ "$doServer" -eq 1 ]; then
printf "[Certificate OK]\n" printf "[Certificate OK]\n"
;; ;;
esac esac
else
printf "[HTTP mode enabled]\n"
fi fi
exec node livereload.js exec node livereload.js
exit "$?" exit "$?"

View File

@ -16,6 +16,7 @@ const options = {
// set debugging output as per LR_DEBUG // set debugging output as per LR_DEBUG
if (process.env.LR_DEBUG === "true") { if (process.env.LR_DEBUG === "true") {
options.debug = true options.debug = true
console.log("[Debug output ENABLED]");
} }
// set HTTPS as per LR_HTTPS // set HTTPS as per LR_HTTPS
@ -24,6 +25,10 @@ if (process.env.LR_HTTPS === "true") {
cert: fs.readFileSync('/certs/fullchain.pem'), cert: fs.readFileSync('/certs/fullchain.pem'),
key: fs.readFileSync('/certs/privkey.pem') key: fs.readFileSync('/certs/privkey.pem')
}; };
console.log("[HTTPS mode]");
}
else {
console.log("[HTTP mode]");
} }
// start server // start server