Skip to content

Instantly share code, notes, and snippets.

@doobeh
Created November 30, 2016 16:29
Show Gist options
  • Save doobeh/35114dc4acf6a000426dd9bb29157f50 to your computer and use it in GitHub Desktop.
Save doobeh/35114dc4acf6a000426dd9bb29157f50 to your computer and use it in GitHub Desktop.
add_url_rule
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