Created
July 20, 2020 15:06
-
-
Save limzykenneth/0bb0575a7dc3ec825833b11f56ae395c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Create HTTP server. | |
*/ | |
let server; | |
if(process.env.NODE_ENV !== "production"){ | |
const https = require("https"); | |
const httpsOptions = { | |
key: fs.readFileSync(path.join(__dirname, "../cert/private.key")), | |
cert: fs.readFileSync(path.join(__dirname, "../cert/public.crt")) | |
}; | |
server = https.createServer(httpsOptions, app); | |
}else{ | |
const http = require("http"); | |
server = http.createServer(app); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment