docs: function(cb) {
      let serverDomain = domain.create();
      serverDomain.on('error', function(err) {
        console.error('Server domain caught an exception: ' + err);
        if (err) {
          console.error(err.stack);
        }
      });
  
      let web = this;
      serverDomain.run(function() {
  
        // Initialize the express server and routes.
        web.initServer();
        let http = require('http');
  
        let alwaysSecure = null;
        if (web.conf.https && web.conf.https.enabled) {
          if (web.conf.https.letsEncrypt) {
            //must do this manuall - npm install --global letsencrypt-cli
            let https = require('https');
            
  
            let lex = web.getLetsEncryptLex();
  
            let httpsPort = web.conf.https.port || 443;
            https.createServer(lex.httpsOptions, lex.middleware(web.app))
            .listen(httpsPort, web.conf.ipAddress, function(err, result) {
              if (err) {
                console.error(err);
              }
              console.log('%s: Node https server started on %s:%d ...',
                          Date(Date.now()), web.conf.ipAddress, httpsPort);
  
              if (cb) {
                cb(err, result);
              }
            });
  
  
  
          } else {
            let https = require('https');
            let privateKey = fs.readFileSync(web.conf.https.privateKey, 'utf8');
            let certificate = fs.readFileSync(web.conf.https.certificate, 'utf8');
            let credentials = {key: privateKey, cert: certificate};
            let httpsServer = https.createServer(credentials, web.app);
  
            httpsServer.listen(web.conf.https.port, web.conf.ipAddress, function(err, result) {
              if (err) {
                console.error(err);
              }
              console.log('%s: Node https server started on %s:%d ...',
                          Date(Date.now()), web.conf.ipAddress, web.conf.https.port);
  
              if (cb) {
                cb(err, result);
              }
            });
          }
  
          alwaysSecure = web.conf.https.alwaysSecure;
        }
        
        if (alwaysSecure && alwaysSecure.enabled) {
          let httpRedirecter = http.createServer(function(req, res) {
  
            if (alwaysSecure.redirectHandler) {
              alwaysSecure.redirectHandler(req, res);
            } else {  
              let nonStandardPort = '';
              if (web.conf.https.port != 443) {
                nonStandardPort = ':' + web.conf.https.port;
              }
              res.writeHead(302, {'Location': 'https://' + req.headers.host.split(':')[0] + nonStandardPort + req.url});
              res.end();
            }
          });
  
          httpRedirecter.listen(web.conf.port, web.conf.ipAddress, function(err, result) {
             if (err) {
                console.error(err);
              }
              
              console.log('%s: http redirecter server started on %s:%d ...',
                          Date(Date.now()), web.conf.ipAddress, web.conf.port);
  
              if (cb) {
                cb(err, result);
              }
          });
        } else {
          let httpServer = http.createServer(web.app);
          //  Start the app on the specific interface (and port).
          httpServer.listen(web.conf.port, web.conf.ipAddress, function(err, result) {
             if (err) {
                console.error(err);
              }
              
              console.log('%s: Node server started on %s:%d ...',
                          Date(Date.now()), web.conf.ipAddress, web.conf.port);
  
              if (cb) {
                cb(err, result);
              }
          });
        }
  
      });
    }