Enable CORS

This commit is contained in:
Marian Steinbach 2018-02-04 22:22:19 +01:00
parent addbc6b140
commit 3620a53ed7
2 changed files with 5 additions and 1 deletions

View File

@ -3,6 +3,7 @@
import falcon
from falcon import media
import logging
from falcon_cors import CORS
from . import events
from . import jsonhandler
@ -29,7 +30,9 @@ handlers = media.Handlers({
'application/json': jsonhandler.JSONHandler(),
})
app = falcon.API()
cors = CORS(allow_origins_list=['*'])
app = falcon.API(middleware=[cors.middleware])
app.req_options.media_handlers = handlers
app.resp_options.media_handlers = handlers

View File

@ -2,6 +2,7 @@ attrs==17.4.0
certifi==2018.1.18
chardet==3.0.4
falcon==1.4.1
falcon-cors==1.1.7
funcsigs==1.0.2
gunicorn==19.7.1
icalendar==4.0.0