Where and how to convert to https

9 views
Skip to first unread message

Bill Harten

unread,
Jul 20, 2013, 12:49:56 AM7/20/13
to cuj...@googlegroups.com
Where and how do I adapt the seed app to use https instead of http? I've configured connect to use https but I don't know where or how to say it with cujo.

Thanks.

Bill Harten

unread,
Jul 20, 2013, 7:56:58 PM7/20/13
to cuj...@googlegroups.com
Ok, I changed serv.js as shown and it works via brute force, but is this the recommended approach? Isn't everything supposed to be configured somewhere else?

...
var https = require('https');
var fs = require('fs');
...

  var options = {
    key: fs.readFileSync('./ssl/privatekey.pem'),
    cert: fs.readFileSync('./ssl/certificate.pem')
  };
  app = express.createServer(options);

Brian Cavalier

unread,
Jul 20, 2013, 9:33:39 PM7/20/13
to cuj...@googlegroups.com, Scott Andrews
Hi Bill,

cujojs/seed is currently targetted primarily at client side projects.  So, serv is included as a quick and easy development-time server to facilitate quick run-fix-run cycles while coding.  For more robust serving with more features, and for production deployment, we recommend using a server that fits your needs.

That said, we can see if Scott Andrews (serv's author, CC'd) has any thoughts about https.

Scott Andrews

unread,
Jul 22, 2013, 10:09:48 AM7/22/13
to cuj...@googlegroups.com
serv was designed as a quick and dirty static http server for development time.  If you need to do SSL termination within the application, instead of at fronting webserver, you can replace serv with a custom express configuration.

serv itself is just a thin wrapper around express:

-Scott
Reply all
Reply to author
Forward
0 new messages