Skip to content

mohsen481/webserver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple http and wsgi webserver

A lightweight, concurrent HTTP web server built from scratch in Python.

Features:

  • multi_threading: utilizes a thread-per-connection model.
  • WSGI Standard Compliance: can serve python wsgi application/frameworks such as flask.
  • static content server: detect static content type automatically and serve it from a configurable root directory.

Getting Started

Prerequisites

  • Python 3.8+
  • Linux / WSL2 environment (Tested on Ubuntu)

To serve static files:

Specify the root directory using the --root flag (Defaults to /):

python3 server1.py --root example
  • start request path with /static
    example: curl localhost:8000/static/

to serve wsgi app:

Pass your application entry point using the --app flag (Format: module_name:app_variable):

python3 server1.py --app module_name:app

example: python3 server1.py --app testflask:app

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages