Saturday, April 15, 2023

One-liner: Python webserver to display files

Go into linux directory that has the files you want to serve.

Start the webserver in the directory of the files you want to expose:

$ python3 -m http.server 8321

Test it from another machine by using a web browser and going to the hostname:port:

To persist the webserver after you log out of the shell, use nohup:

$ nohup python3 -m http.server 8321 &

No comments:

Post a Comment