-
-
Save aib/b139faa6f95b37c15475569e7f34d99b to your computer and use it in GitHub Desktop.
add_url_rule
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, request, jsonify | |
app = Flask(__name__) | |
app.secret_key = 'aib' | |
def homer(): | |
def home(): | |
return 'Ok' | |
return home | |
app.add_url_rule('/', 'something', homer()) | |
app.add_url_rule('/other', 'something', homer()) | |
if __name__ == '__main__': | |
with app.test_client() as c: | |
print(c.get('/').data) | |
print(c.get('/other').data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment