Skip to content

0xgouda/LittleWSGI

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

LittleWsgi

  • Just a little Python framework for exploring WSGI

example usage

from src.router import Router
from src.app import LittleWSGI
from src.middlewares.logging_middleware import LoggingMiddleware
from http import HTTPMethod

router = Router()
@router.route(HTTPMethod.POST, '/greet')
def fun(x: str):
    return f"Hello, {x}"

data = [1, 2, 3, 4]
@router.route(HTTPMethod.GET, '/data')
def fun2() -> list:
    return data

app = LittleWSGI(router=router)
app.add_middleware(LoggingMiddleware())

running

gunicorn example:app -b :8888
...
[INFO] GET /data 200 OK -> 0.05 ms

About

A mini WSGI framework. Built for fun, experiments, and weekend hacks

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages