I have a flask route app.add_url_rule("/<string:name>",'welcome',DataProcessor.welcome) what I want is to make the name parameter optional. How can I do it inside the add_url_rule method?
1 Answer
app.add_url_rule() does exactly the same as the @app.route() decorator. Therefore, this answer might help you out.
In short, it's not possible without setting default values to those parameters.
You can either use that approach, or use the request.args.