I have a flask method/view which has to be executed for multiple routes. I dont need the values of url as a variable. I just need to route multiple url to same method without stacking up app.routes for each urls.
I tried AnyConverter in app.routes but its not working fine.
Tried AnyConverter:
@app.route('/<any(/something/some):segment>' , methods=('POST','GET') )
def postbacks():
......
presently my code looks
@app.route('/something0/z',methods=('POST','GET'))
@app.route('/something1/a',methods=('POST','GET'))
@app.route('/something2/b',methods=('POST','GET'))
@app.route('/something3/c', methods=('POST','GET'))
def postbacks():
......
I have all the list of routes in a list. How to use anyconverter to include a list of routes to a same method.