There, you can change your local hostname to anything you like. Then, right under where you can change your computer name, click the “Edit…” button. In macOS (I’m using 10.14.5 so you might have a slightly different path on other versions), open up System Preferences and go to Sharing. This can be done for Windows and Linux as well, but you’ll have to figure out the steps yourself for those platforms. Very helpful when doing mobile development work. It’s basically creating a custom URL that can access your device locally. If you’re on macOS, there’s a very handy configuration setting you can setup to make it easy to access your local dev environment over your local network.
After several hours of trial and error, let me show you the easiest way to setup HTTPS on your localhost environment. I was recently working on a mobile application that I needed HTTPS to test on my local device rather than just on the desktop.