-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathexample.py
More file actions
28 lines (21 loc) · 777 Bytes
/
example.py
File metadata and controls
28 lines (21 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
"""
flask-headers example
===================
This is a tiny Flask Application demonstrating flask-headers, makign it simple
to add cross origin support to your flask app!
:copyright: (C) 2013 by Cory Dolphin.
:license: MIT/X11, see LICENSE for more details.
"""
from flask import Flask, request
try:
from flask_headers import headers # support local usage without installed package
except:
from flask.ext.headers import headers # this is how you would normally import
app = Flask(__name__)
@app.route("/")
@headers(foo='bar')
def helloWorld():
return '''<h1>Hello Flask-Headers!</h1> Checkout my documentation
on <a href="https://github.com/wcdolphin/flask-headers">Github</a>'''
if __name__ == "__main__":
app.run(debug=True)