In my Flask application, I want to open the URI as follows:
http://<base_uri>/some_string
and I want to handle requests to it differently depending on whether some_string an integer or not.
With Sinatra, I can achieve this through passing ", as shown below:
get '/:some_string' do if is_integer(:some_string) 'Your URI contains an integer' else pass
Here, calling pass in the first route allows the second route to process the request if :some_string not an integer.
I could not find equivalent functionality in Flask. Can anyone suggest a solution in Flask?
source share