bugaevc / simple-http-server-tutorial

A step-by-step walkthrough of implementing a very basic HTTP server and a webapp nanoframework in pure Python

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple HTTP server tutorial

This tutorial is a step-by-step walkthrough of implementing a very basic HTTP server and a nanoframework for web apps in pure Python on top of bare TCP sockets. The server won't be as advanced or feature-reach as leek or Python's built-in http.server, and the nanoframework won't be as complete as Flask, but they have enough functionality to support parsing basic GET and POST requests, dispatching them to a collection of handlers and sending back the response.

The server and nanoframework implementation takes up about 150 lines of Python code; it's followed by another 50 lines implementing a simple to-do list webapp on top of the nanoframework to demonstrate using its API and make it possible to run and test the whole thing.

About

A step-by-step walkthrough of implementing a very basic HTTP server and a webapp nanoframework in pure Python

License:MIT License


Languages

Language:Python 100.0%