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
  • SimpleRegexRouter: simple regex-based 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.5.tar.gz (4.6 kB view hashes)

Uploaded Source

Built Distribution

tiny_router-0.0.5-py3-none-any.whl (6.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page