In flask I know it can use subdomain, but I want to set some different subdomain in same routing. Is there a way we can use regular expressions in subdomain just like in its URL routing?like:
@app.route('/', subdomain='<regex("www|test"):subdomain>')
def example(subdomain):
return "{}".format(subdomain)
if __name__ == '__main__':
app.run(debug=True)
But there is new question, if I don't want the argument like this one, what should I do?
@app.route('/', subdomain='<regex("www|test"):subdomain>')
def example():
return "test"
if __name__ == '__main__':
app.run(debug=True)