how should i force https
Koalaknightmi (1)

in a node.js project with a html webpage what is the best way to force a incoming http request to https

You are viewing a single comment. View All
mat1 (2508)

You can add this small code snippet to your html to convert http to https:

<script>if(location.protocol!=="https:"){location.protocol="https:"}</script>

Please mark my comment as the answer if it answered your question. Thanks!