A simple routing library
Project description
CodeRouter
A simple routing library for Python applications.
Installation
pip install coderouter
Usage
from coderouter import Router
router = Router()
def home_handler():
return "Welcome home!"
def about_handler():
return "About page"
router.add_route("/", home_handler)
router.add_route("/about", about_handler, methods=["GET", "POST"])
# Handle requests
result = router.handle("/") # Returns "Welcome home!"
result = router.handle("/about", "POST") # Returns "About page"
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
coderouter-0.1.0.tar.gz
(1.9 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file coderouter-0.1.0.tar.gz.
File metadata
- Download URL: coderouter-0.1.0.tar.gz
- Upload date:
- Size: 1.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e486fad75db732eb689db4579cccc9ec6cb03f4c96f8e24d9ebea6935370a143
|
|
| MD5 |
5ec81a2215fc3d4b456a59c837d93fe1
|
|
| BLAKE2b-256 |
14ed00a0459c0c81612d65af3feccb468f85ea1d0428362d436944d3a21d8550
|
File details
Details for the file coderouter-0.1.0-py3-none-any.whl.
File metadata
- Download URL: coderouter-0.1.0-py3-none-any.whl
- Upload date:
- Size: 2.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
205fde590197c632320b667cb0b025d6563a20110ccd712ee95d20e8e0c763d8
|
|
| MD5 |
5d13bb5a58b8316e8aa00dcc19f634fd
|
|
| BLAKE2b-256 |
37b09b3f818f9b8080e5e5a1c29da04f066b3996d3539ab8f3279928544f046b
|