Enable CORS
This commit is contained in:
parent
addbc6b140
commit
3620a53ed7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue