Building a NestJS Application I want to route ALL incoming traffic through https without inconvenience for the user.
So far there are two ways I know, both doesn't fit my requirements.
Set up two servers for http and https and than redirect traffic per route/api endpoint, which is really not DRY and cannot be best practice. Doc redirect
By only creating the https server, the user would always be forced to type the https address manually what I don't want. Doc https
Ideally I would assume a solution where https is checked and forced the very first moment some one is hitting the server by just typing example.com. I think this would best be done in main.ts of my NestJS application.