Redirect all requests from HTTP to HTTPS un Node.js and Express

The first step will be to create a method to guess if the HTTP request comes from HTTP or HTTPS (secure or not secure). In some context like AWS or Heroku you will have to ask by the header x-forwarded-proto instead of req.secure. Have in mind that req.secure will return always false if there is … Continue reading Redirect all requests from HTTP to HTTPS un Node.js and Express