src/index.js
/**
 * Start web server, optionally require secure socket.
 */
Start web server, optionally require secure socket.
Start web server optionally require secure socket .
function startWebServer() {
  if (sslEnabled) {
    const key = fs.readFileSync("cert/server.key", "utf8");
    const cert = fs.readFileSync("cert/domain.crt", "utf8");
    const httpsServer = https.createServer({ key, cert }, app);
    app.use(graceful(httpsServer, { logger: console, forceTimeout: 30000 }));
    httpsServer.listen(sslPort, function () {
      console.info(`\n🌎 https://localhost:${sslPort} 🌎\n`);
    });
    return;
  }
  const httpServer = http.createServer(app);
  app.use(graceful(httpServer, { logger: console, forceTimeout: 30000 }));
  httpServer.listen(port, function () {
    console.info(`\n🌎 https://localhost:${port} 🌎\n`);
  });
}
function startWebServer ( ) { if ( sslEnabled ) { const key = fs . readFileSync ( "cert/server.key" , "utf8" ) ; const cert = fs . readFileSync ( "cert/domain.crt" , "utf8" ) ; const httpsServer = https . createServer ( { key , cert } , app ) ; app . use ( graceful ( httpsServer , { logger : console , forceTimeout : 30000 } ) ) ; httpsServer . listen ( sslPort , function ( ) { console . info ( ` \n sl Port} 🌎 \ } ) ; return ; } const httpServer = http . createServer ( app ) ; app . use ( graceful ( httpServer , { logger : console , forceTimeout : 30000 } ) ) ; httpServer . listen ( port , function ( ) { console . info ( ` \n or t} 🌎 \ } ) ; }
Start web server, optionally require secure socket.
Start web server optionally require secure socket .