jgontrum / spacy-api-docker

spaCy REST API, wrapped in a Docker container.
https://hub.docker.com/r/jgontrum/spacyapi/
MIT License
265 stars 99 forks source link

Upgrade to Falcon 3 for CORS #45

Open wacimbel opened 3 years ago

wacimbel commented 3 years ago

Hello, I needed to authorize CORS on the Docker API, and generate an updated Docker image. To solve it, I upgraded the falcon dependency to 3.0.1, in order to use simple CORS configuration here on line 1 :

APP = falcon.API(cors_enable=True)
APP.add_route('/dep', DepResource())
APP.add_route('/ent', EntResource())
APP.add_route('/sents', SentsResources())
APP.add_route('/sents_dep', SentsDepResources())
APP.add_route('/{model_name}/schema', SchemaResource())
APP.add_route('/models', ModelsResource())
APP.add_route('/version', VersionResource())

If you want me to integrate these changes in your repo, keep me posted ;)