Skip to main content

Tiny HTTP router

Project description

tiny-router

PyPI PyPI - Python Version Code style: black license

A tiny HTTP router like this:

from tiny_router import SimpleRouter

router = SimpleRouter()


@router.get("/users")
def list_users():
    ...


@router.post("/users")
def create_user():
    ...


another_router = SimpleRouter()
router.include(another_router)

route = router.resolve("GET", "/users")

Features

  • SimpleRouter: exact-match router
  • Abstract Router: user can implement their own routers
  • Support for type hints

Usage

See examples/ directory of repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tiny-router-0.0.4.tar.gz (3.5 kB view hashes)

Uploaded source

Built Distribution

tiny_router-0.0.4-py3-none-any.whl (4.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page