How can I make the path /name/int/float be optional.
So if I did: http://localhost/Zeref/ it would still work despite not inputting an int or float.
And if I did http://localhost/Zeref/1/ It will do just name and the int not the float.
So what can I do to make them optional?
Code:
import flask
win = flask.Flask(__name__)
@win.route("/<name>/<int:ints>/<float:floats>")
def web(name, ints, floats):
return "Welcome Back: %s Your Int: %d Your Float: %f" % (name, ints, floats)
win.run("localhost", 80)