This is something that Browsersync does (among probably a lot of other things).
Install with
npm i -g browser-sync
Serve the contents of the current directory with
browser-sync start -s --https
No setup required. See the docs for other features. You probably want the --cors
flag.