Class CorsFeature

java.lang.Object
io.helidon.webserver.cors.CorsFeature
All Implemented Interfaces:
RuntimeType.Api<CorsConfig>, io.helidon.common.config.NamedService, ServerFeature

public class CorsFeature extends Object implements ServerFeature, RuntimeType.Api<CorsConfig>
Adds CORS support to Helidon WebServer.
  • Field Details

    • WEIGHT

      public static final double WEIGHT
      Default weight of the feature.
      See Also:
  • Method Details

    • builder

      public static CorsConfig.Builder builder()
      Fluent API builder to set up an instance.
      Returns:
      a new builder
    • create

      public static CorsFeature create(CorsConfig config)
      Create a new instance from its configuration.
      Parameters:
      config - configuration
      Returns:
      a new feature
    • create

      public static CorsFeature create(Consumer<CorsConfig.Builder> builderConsumer)
      Create a new instance customizing its configuration.
      Parameters:
      builderConsumer - consumer of configuration
      Returns:
      a new feature
    • create

      public static CorsFeature create()
      Create a new CORS feature with default setup.
      Returns:
      a new feature
    • create

      public static CorsFeature create(io.helidon.common.config.Config config)
      Create a new CORS feature with custom setup.
      Parameters:
      config - configuration
      Returns:
      a new configured feature
    • setup

      public void setup(ServerFeature.ServerFeatureContext featureContext)
      Specified by:
      setup in interface ServerFeature
    • name

      public String name()
      Specified by:
      name in interface io.helidon.common.config.NamedService
    • type

      public String type()
      Specified by:
      type in interface io.helidon.common.config.NamedService
    • prototype

      public CorsConfig prototype()
      Specified by:
      prototype in interface RuntimeType.Api<CorsConfig>