Advertisement
Adam_Martin

Untitled

Jul 8th, 2013
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var express = require('express');
  2. var https = require('https');
  3. var http = require('http');
  4. var fs = require('fs');
  5.  
  6. // This line is from the Node.js HTTPS documentation.
  7. var options = {
  8.   key: fs.readFileSync('test/fixtures/keys/agent2-key.pem'),
  9.   cert: fs.readFileSync('test/fixtures/keys/agent2-cert.pem')
  10. };
  11.  
  12. // Create a service (the app object is just a callback).
  13. var app = express();
  14.  
  15. // Create an HTTP service.
  16. http.createServer(app).listen(80);
  17. // Create an HTTPS service identical to the HTTP service.
  18. https.createServer(options, app).listen(443);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement