def setup_app(app, api):
    """setup the resources urls."""
    api.add_resource(
        KnwKBAllResource,
        '/api/knowledge'
    )
    api.add_resource(
        KnwKBResource,
        '/api/knowledge/<string:slug>'
    )
    api.add_resource(
        KnwKBMappingsResource,
        '/api/knowledge/<string:slug>/mappings'
    )
    api.add_resource(
        KnwKBMappingsToResource,
        '/api/knowledge/<string:slug>/mappings/to'
    )
    api.add_resource(
        KnwKBMappingsFromResource,
        '/api/knowledge/<string:slug>/mappings/from'
    )

    # for other urls, return "Method Not Allowed"
    api.add_resource(
        NotImplementedKnowledegeResource,
        '/api/knowledge/<string:slug>/<path:foo>'
    )
def setup_app ( app , api ) : api . add_resource ( KnwKBAllResource , '/api/knowledge' ) api . add_resource ( KnwKBResource , '/api/knowledge/<string:slug>' ) api . add_resource ( KnwKBMappingsResource , '/api/knowledge/<string:slug>/mappings' ) api . add_resource ( KnwKBMappingsToResource , '/api/knowledge/<string:slug>/mappings/to' ) api . add_resource ( KnwKBMappingsFromResource , '/api/knowledge/<string:slug>/mappings/from' ) api . add_resource ( NotImplementedKnowledegeResource , '/api/knowledge/<string:slug>/<path:foo>' )
setup the resources urls.