Allowed Origins
To allow any origin for a given configuration, simply don’t include the allowedOrigins
key in your configuration.
To specify a list of valid origins, set the allowedOrigins
key of the configuration to a list of strings. Each value can either be a static value ([http://www.foo.com](http://www.foo.com)
) or a regular expression (^http(|s)://www\.google\.com$
).
Any regular expressions are passed to Pattern#compile and compared to the request origin with Matcher#matches.
Example CORS Configuration
micronaut:
server:
cors:
enabled: true
configurations:
web:
allowedOrigins:
- http://foo.com
- ^http(|s):\/\/www\.google\.com$