def create_app(loop): app = web.Application(loop=loop) app["config"] = {"test": "foo"} app.router.add_route('GET', '/', handle) add_route(app, multiple_query_params) add_route(app, multiply) add_route(app, get_id) route(app, config) route(app, get_optional) route(app, body_and_header) route(app, error) route(app, api_exception) # this should be at the end, to ensure all routes are considered when # constructing the handler. add_swagger(app, "/swagger.json", "/swagger") return app
def add_event_api(app): route(app, get_event) route(app, post_event) route(app, delete_event) route(app, put_event) route(app, get_children_events) route(app, get_parent_events_until_source) route(app, get_events) route(app, get_event_impact) app.router.add_route('GET', "/event/{event_id}/", get_event_root_and_impact_diagram)