Serving Files with Python’s SimpleHTTPServer Module

python_tutorials

Introduction

Servers are computer software or hardware that processes requests and deliver data to a client over a network. Various types of servers exist, with the most common ones being web servers, database servers, application servers, and transaction servers.

Widely used web servers such as Apache, Monkey, and Jigsaw are quite time-consuming to set up when testing out simple projects and a developer’s focus is shifted from producing application logic to setting up a server.

Python’s SimpleHTTPServer module is a useful and straightforward tool that developers can use for a number of use-cases, with the main one being that it is a quick way to serve files from a directory.

It eliminates the laborious process associated with installing and implementing the available cross-platform web servers.

Note: While SimpleHTTPServer is a great way to easily serve files from a directory, it shouldn’t be used in a production environment. According to the official Python docs, it “only implements basic security checks.”

What is an HTTP Server

HTTP stands for HyperText Transfer Protocol. Let us think of a protocol as a spoken language like English. English has a set of rules

To finish reading, please visit source site