Add CORS header
This commit is contained in:
parent
e0ced162f4
commit
6bb2c6e2e5
1 changed files with 3 additions and 3 deletions
|
@ -195,13 +195,15 @@ def list_quotes():
|
||||||
@app.route('/quotes.json', methods=['GET'])
|
@app.route('/quotes.json', methods=['GET'])
|
||||||
def json_quotes():
|
def json_quotes():
|
||||||
all_quotes = models.Quote.query.all()
|
all_quotes = models.Quote.query.all()
|
||||||
return jsonify(list({
|
response = jsonify(list({
|
||||||
'quoter': q.quoter,
|
'quoter': q.quoter,
|
||||||
'quotee': q.quotee,
|
'quotee': q.quotee,
|
||||||
'channel': q.channel,
|
'channel': q.channel,
|
||||||
'quote': q.quote,
|
'quote': q.quote,
|
||||||
'created_at': q.created_at.isoformat()
|
'created_at': q.created_at.isoformat()
|
||||||
} for q in all_quotes))
|
} for q in all_quotes))
|
||||||
|
response.headers.add('Access-Control-Allow-Origin', '*')
|
||||||
|
return response
|
||||||
|
|
||||||
RESTO_TEMPLATE = """
|
RESTO_TEMPLATE = """
|
||||||
# Resto menu
|
# Resto menu
|
||||||
|
@ -256,5 +258,3 @@ def resto_menu():
|
||||||
@app.route('/resto.json', methods=['GET'])
|
@app.route('/resto.json', methods=['GET'])
|
||||||
def resto_menu_json():
|
def resto_menu_json():
|
||||||
return mattermost_response(resto_menu(), ephemeral=True)
|
return mattermost_response(resto_menu(), ephemeral=True)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue