Skip to content

Commit

Permalink
feat: configure CORS - allow all origins
Browse files Browse the repository at this point in the history
  • Loading branch information
fengelniederhammer committed Oct 16, 2023
1 parent b14c91e commit a7230f6
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions lapis2/src/main/kotlin/org/genspectrum/lapis/CorsConfiguration.kt
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit a7230f6

Please sign in to comment.