Skip to content

REST API CORS support #17

@softwaretailoring

Description

@softwaretailoring

I built my own Docker image as suggested in #14.
Now I can use the REST API without the Internal Server Error.
However, there is a CORS issue.

When I tried an API call via Ajax request I got the following error:

Access to XMLHttpRequest at 'http://localhost:5000/tok/morph/pos/conv-morph/dep' from origin 'https://localhost:44399' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I can solve it with a new Docker build with modified uwsgi.ini.
I've added this line:

add-header = Access-Control-Allow-Origin: https://localhost:44399

Do you want to provide CORS support? Maybe in a configurable manner?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions