I have multiple routes which have the same URL root. Example:
Can I define abc/def to be URL root. (Something similar to what can be done in Java using Spring or Apache CXF)
Thanks
In flask-restful it is possible to prefix all your routes on api initialization:
>>> app = Flask(__name__)
>>> api = restful.Api(app, prefix='/abc/def')
You can then wire your resources ignoring any prefixes:
>>> api.add_resource(MyResource, '/upload')
>>> ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With