title: Get restify REST API server to support both HTTPS and HTTP
body: <p>I am using node.js restify ver4.0.3</p>
  
  <p>The simple following code works as a simple REST API server that supports HTTP. An example API call is <a href="http://127.0.0.1:9898/echo/message" rel="noreferrer">http://127.0.0.1:9898/echo/message</a></p>
  
  <pre><code>var restify = require('restify');
  
  var server = restify.createServer({
      name: 'myapp',
      version: '1.0.0'
  });
  server.use(restify.acceptParser(server.acceptable));
  server.use(restify.queryParser());
  server.use(restify.bodyParser());
  
  //http://127.0.0.1:9898/echo/sdasd
  server.get('/echo/:name', function (req, res, next) {
      res.send(req.params);
      return next();
  });
  
  server.listen(9898, function () {
      console.log('%s listening at %s', server.name, server.url);
  });
  </code></pre>
  
  <p>Suppose I want to support HTTPS and make the API call <a href="https://127.0.0.1:9898/echo/message" rel="noreferrer">https://127.0.0.1:9898/echo/message</a></p>
  
  <p>How can this be done? </p>
  
  <p>I noticed that restify code changes pretty fast and older code with older version may not work with the latest version.</p>