# Cross-origin resource sharing (CORS)

How do I configure my application for CORS?

    $ curl localhost:9999/ -i
    HTTP/1.1 200 OK
    Access-Control-Allow-Methods: OPTIONS,POST,GET
    Access-Control-Allow-Origin: mydomain.com
    Access-Control-Allow-Credentials: true
    Access-Control-Allow-Headers: origin, content-type, accept, authorization, x-xsrf-token, x-request-id
    content-length: 3
    connection: keep-alive
    content-type: text/plain; charset=utf-8
    ...
    $ curl localhost:9999/ -i -X OPTIONS     
    HTTP/1.1 204 No Content
    Access-Control-Allow-Methods: GET,POST,OPTIONS
    Access-Control-Allow-Origin: mydomain.com
    Access-Control-Allow-Credentials: true
    Access-Control-Allow-Headers: origin, content-type, accept, authorization, x-xsrf-token, x-request-id
    connection: keep-alive
    

    Also, checkout some resources from the community:

    MIT Licensed
    Copyright © 2018-present Sanic Community Organization

    ~ Made with ❤️ and ☕️ ~