serve-handler
serve-handler copied to clipboard
Redirect http to https?
Is it possible to do redirect from http to https using redirects? If so, how?
Something like this
redirects: [{
source: "http://**",
destination: 'https://**',
type: 301
}]
but source is phrased incorrectly or the protocol part cannot be used.
I just debugged it because I was wondering the same. It sends in a relative path for comparison. So redirects is not the way.
Anyone figure out how to do this? I had tried the same as @magnus80a and now I'm here :)
It seems the only other option is creating your own node server.
I'd love for there to be a drop-in serve.json option that would do this every time. Is this something that could be added?
shameless self-promotion alert:
this feature is available in my @warren-bank/serve
fork of serve
see: the --force-https
option