[Vuejs]-Express.js net::ERR_CONNECTION_CLOSED

0👍

Ok, so from the comments, a few things to look at.

1) “localhost” means your computer. If your client code is trying to hit that, it’s going to need a server running on your machine and serving your server-side code. You absolutely need to have a web-accessible domain name (like the one heroku provided you: app-name.herokuapp.com) to be able to hit your serverside code when it’s hosted on heroku (or any other web host).

2) If you want to use HTTPS, then you have to buy and install an SSL certificate. It won’t be for the herokuapp domain, so you’ll also need to buy a domain name and set that up for yourself. All of that is explained on the heroku docs: https://devcenter.heroku.com/articles/ssl-endpoint

Hope that helps.

👤Paul

0👍

I figured out and ssl requests working like a charm on my Centos6.9

  • install virtualmin on your server
  • setup Lets encrypt
  • Just refer

before your call to
var app = express();
or any other http(s) mechanism or app.listen(port),

  var options = {
    key: fs.readFileSync('/home/yourdomain/ssl.key'),
    cert: fs.readFileSync('/home/domain/ssl.cert'),
  };

Note: you must take in to account about ‘No Access control allow origin’

Leave a comment