Created
November 30, 2016 16:29
-
-
Save doobeh/35114dc4acf6a000426dd9bb29157f50 to your computer and use it in GitHub Desktop.
add_url_rule
This file contains 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 home(): | |
return 'Ok' | |
app.add_url_rule('/', 'something', home) | |
app.add_url_rule('/other', 'something', home) | |
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