Visiting localhost from a physical Android device

I recently had to test a web app I was developing on an real mobile phone, so I had to figure out how to (1) run the development server on my computer, and (2) access it from the Android phone I had in my hand. Most of the how-tos I found online were either outdated, or felt like they were a bit too complicated for what I was trying to achieve. I did not want to have to switch my computer network…