What is `http.server` module?

0158

The http.server module is a built-in Python module that provides a simple HTTP server. It allows you to quickly set up a web server to serve files over HTTP without needing complex configurations. This module is particularly useful for testing and development purposes.

You can use it to serve static files, such as HTML, CSS, and JavaScript, by running a command like:

python3 -m http.server <port>

This command starts the server on the specified port (default is 8000) and makes the files in the current directory accessible via a web browser.

0 Comments

no data
Be the first to share your comment!