def app():

    app = Hypr()
    app.router.add_provider(Root, "/root/<int:value>")
    app.router.add_provider(Resource, "/resource")
    app.propagate()

    return app
Exemple #2
0
def app(request):

    app = Hypr(__name__)
    app.config.from_object(request.module)

    for provider, urls in getattr(request.cls, 'providers', {}).items():

        if not isinstance(urls, tuple):
            urls = urls,

        app.router.add_provider(provider, *urls)

    app.propagate()
    return app
Exemple #3
0
def app(request):

    app = Hypr()

    for provider, urls in request.cls.providers.items():

        if isinstance(provider, str):
            provider = getattr(
                request.module,
                provider,
                type(provider, (cp_provider_factory(),), {})
            )

        if not isinstance(urls, tuple):
            urls = urls,
        app.router.add_provider(provider, *urls)

    app.propagate()
    return app
Exemple #4
0
def app(request):

    app = Hypr()

    for provider, urls in getattr(request.cls, 'providers', {}).items():

        if isinstance(provider, str):
            provider = getattr(
                request.module,
                provider,
                type(provider, (ProviderTemplate,), {})
            )

        if not isinstance(urls, tuple):
            urls = urls,

        app.router.add_provider(provider, *urls)

    app.propagate()
    return app