You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

3 anni fa
12345678910111213141516171819202122232425262728293031
  1. #!/usr/bin/env node
  2. var debug = require('debug')('my-application');
  3. var app = require('../app');
  4. var http = require('http');
  5. var https = require('https');
  6. var fs = require('fs');
  7. // Https run
  8. /*
  9. const httpsOptions = {
  10. cert: fs.readFileSync('/etc/letsencrypt/live/rpcexplorer.smartcash.cc/fullchain.pem'),
  11. key: fs.readFileSync('/etc/letsencrypt/live/rpcexplorer.smartcash.cc/privkey.pem')
  12. }
  13. https.createServer(httpsOptions, app).listen(443, function() {
  14. debug('Https/Express server listening on port 443');
  15. });
  16. // Forwarding http to https
  17. http.createServer(function (req, res) {
  18. res.writeHead(301, { "Location": "https://" + req.headers['host'] + req.url });
  19. res.end();
  20. }).listen(80);
  21. */
  22. // Http run
  23. app.set('port', process.env.PORT || 80);
  24. var server = app.listen(app.get('port'), function() {
  25. debug('Express server listening on port ' + server.address().port);
  26. });