Here is a one-liner Python code to run a simple HTTP server:
main.py22 chars2 lines
This command will start a web server at port 8000 by default, and serve files from the current directory. You can specify a different port number as follows:
main.py27 chars2 lines
This will start the web server at port 8080.
Note that while this method is convenient for simple web serving needs, it is not recommended for production use as it lacks proper security and error handling features.
gistlibby LogSnag