xweb-router
Router middleware for xweb
Usage
from xweb import App
from xweb_router import Router
app = App()
router = Router()
nested = Router()
app.use(router)
@router.use('/')
async def middleware(ctx, fn):
"""Router Middleware"""
print('middleware')
await fn()
@router.post('/')
async def home(ctx):
ctx.body = "Home"
@router.get('/{name}')
async def hello(ctx):
"""URL parameters"""
ctx.body = f"Hello {ctx.params.name}"
router.use('/post')(nested)
@nested.get('/index')
async def index(ctx):
ctx.body = "Nested Index"
if __name__ == '__main__':
app.listen(8000)
Nested Router
Metadata
Release files for xweb-router 0.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| xweb_router-0.1.1.tar.gz | 2.4 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| xweb_router-0.1.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 4.8 kB
Release files / xweb_router-0.1.1.tar.gz
| Download URL | xweb_router-0.1.1.tar.gz |
|---|---|
| Size | 2.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
726fbebba94b3e50ec1c0a82eebc3961cb95524d01806b2fc17a4d3931bb273e
|
|
BLAKE2b-256 checksum How to use checksums |
7ce93c448ae4adb3a599a36a116d13405d667edc28a0534eb81e6c7ec6d26534
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Release files / xweb_router-0.1.1-py3-none-any.whl
| Download URL | xweb_router-0.1.1-py3-none-any.whl |
|---|---|
| Size | 2.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
103981f1b5df4bb08d2f731eccf66b973f5e6df160c86c2bd804c1f5380aa969
|
|
BLAKE2b-256 checksum How to use checksums |
9cd8e8fb9446b4f90266b01d8e9a57c1be43fec9cf2514aecdbd124c65fc97f1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.11.0 pkginfo/1.4.2 requests/2.19.1 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.24.0 CPython/3.6.5
|
Security for xweb-router 0.1.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.