Add CORS capability to Flask
Add static blog demo files
This commit is contained in:
parent
4a8cad8a00
commit
4e6c59362c
36 changed files with 6100 additions and 0 deletions
|
|
@ -5,6 +5,7 @@ import os
|
|||
import sys
|
||||
import logging
|
||||
from werkzeug.contrib.fixers import ProxyFix
|
||||
from flask.ext.cors import CORS
|
||||
|
||||
# add current and parent path to syspath
|
||||
currentPath = os.path.dirname(__file__)
|
||||
|
|
@ -45,6 +46,9 @@ app.wsgi_app = ProxyFix(app.wsgi_app)
|
|||
|
||||
logger.info("Start Stacosys application")
|
||||
|
||||
# enable CORS
|
||||
cors = CORS(app, resources={r"/comments/*": {"origins": "*"}})
|
||||
|
||||
app.run(host=config.HTTP_ADDRESS,
|
||||
port=config.HTTP_PORT,
|
||||
debug=config.DEBUG, use_reloader=False)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue