Search code examples
python-3.xlocalhostporthttpserver

How can you run http.server without a port and simply on localhost?


I usually start http.server by typing python3 -m http.server port and I can access the server by going to localhost:port

My goal is to access the srver by simply typing localhost.


Solution

  • There is always port... the default is 80, so just run it on 80 and you'll reach it by just localhost.