diff --git a/lapis2/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt b/lapis2/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt new file mode 100644 index 00000000..1bd66151 --- /dev/null +++ b/lapis2/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt @@ -0,0 +1,16 @@ +package org.genspectrum.lapis + +import org.springframework.context.annotation.Configuration +import org.springframework.web.servlet.config.annotation.CorsRegistry +import org.springframework.web.servlet.config.annotation.WebMvcConfigurer + +@Configuration +class CorsConfiguration : WebMvcConfigurer { + override fun addCorsMappings(registry: CorsRegistry) { + registry.addMapping("/**") + .allowedOrigins("*") + .allowedMethods("GET", "POST", "OPTIONS") + .allowedHeaders("*") + .maxAge(3600) + } +}