Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

32 rindas
890B

  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. });