infrastructure-asfquart

Apache infrastructure

APACHE-2.0 License

Downloads
371
Stars
1
Committers
6

asfquart - a Quart framework for the ASF

This repository will house the future Quart framework for use within ASF web applications. Nothing much to see here yet...

For more detailed documentation, see the documentation page.

Primer

import asfquart
from asfquart.auth import Requirements as R

def my_app():
    # Construct the quart service. By default, the oauth gateway is enabled at /oauth.
    app = asfquart.construct("my_app_service")

    @app.route("/")
    async def homepage():
        return "Hello!"

    @app.route("/secret")
    @asfquart.auth.require(R.committer)
    async def secret_page():
      return "Secret stuff!"
    
    asfquart.APP.run(port=8000)


if __name__ == "__main__":
    my_app()