Skip to main content

Router middleware for xweb.

Project description


Router middleware for xweb


from xweb import App

from xweb_router import Router

app = App()
router = Router()
nested = Router()


async def middleware(ctx, fn):
    """Router Middleware"""
    await fn()'/')
async def home(ctx):
    ctx.body = "Home"

async def hello(ctx):
    """URL parameters"""
    ctx.body = f"Hello {}"


async def index(ctx):
    ctx.body = "Nested Index"

if __name__ == '__main__':

Nested Router


Download files

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

Source Distribution

xweb_router-0.1.1.tar.gz (2.4 kB view hashes)

Uploaded source

Built Distribution

xweb_router-0.1.1-py3-none-any.whl (2.5 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