///////////////////////////////////////////////////////////////////////////////

    Copyright (c) 2020 Oracle and/or its affiliates.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

        http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

///////////////////////////////////////////////////////////////////////////////

= About CORS in Helidon MP
:toc:
:toc-placement: preamble
:h1Prefix: MP
:pagename: intro-cors-in-mp
:description: Introduction to CORS in Helidon MP
:keywords: helidon, java, cors, mp, microprofile, cross-origin resource sharing
:javadoc-base-url-api: {javadoc-base-url}io.helidon.microprofile.cors/io/helidon/microprofile/cors
:helidon-tag: https://github.com/oracle/helidon/tree/{helidon-version}
:quickstart-example: {helidon-tag}/examples/quickstarts/helidon-quickstart-mp
:cors-spec: https://www.w3.org/TR/cors/
:helidon-mp-cors-example: {helidon-tag}/examples/microprofile/cors
:common-page-prefix-inc: ../../shared/cors/common_shared.adoc
:se-pages-prefix-inc: ../../se/cors
:se-intro-page-inc: {se-pages-prefix-inc}/01_introduction.adoc
:mp-pages-ref-prefix: mp/cors
:mp-using-cors-ref: {mp-pages-ref-prefix}/02_using-cors.adoc
:mp-cors-config-ref: {mp-pages-ref-prefix}/03_configuration-with-cors-mp.adoc
:mp-cors-builtin-services-ref: {mp-pages-ref-prefix}/04_support-in-builtin-services.adoc
:helidon-variant: MP

link:{cors-spec}[Cross-origin resource sharing] (CORS) support in Helidon MP provides a flexible
mechanism that allows a Helidon MP application to control how another web application can access its resources,
even if that web application is served from a different domain.


== Overview
include::{common-page-prefix-inc}[tag=cors-intro]

== Next Steps
To introduce CORS into your Helidon MP application, do any or all of the following:

* Modify your code using the Helidon MP CORS API. <<{mp-using-cors-ref}, Learn more.>>
* Use configuration to allow users to override the CORS settings established in your application code. <<{mp-cors-config-ref},Learn more.>>
* Update your application to include any of the built-in Helidon services that automatically
support CORS. <<{mp-cors-builtin-services-ref},Learn more.>>
