Skip to content

Commit

Permalink
Merge pull request #38 from ODOICHON/chore/infra
Browse files Browse the repository at this point in the history
fix: CORS
  • Loading branch information
YoonTaeMinnnn authored Mar 20, 2023
2 parents 75cdb73 + f0024de commit 7222ff4
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,22 @@ package com.example.jhouse_server.global.config
import com.example.jhouse_server.global.resolver.AuthUserResolver
import org.springframework.context.annotation.Configuration
import org.springframework.web.method.support.HandlerMethodArgumentResolver
import org.springframework.web.servlet.config.annotation.CorsRegistry
import org.springframework.web.servlet.config.annotation.EnableWebMvc
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer

@Configuration
@EnableWebMvc
class WebConfig (
val authUserResolver: AuthUserResolver
): WebMvcConfigurer {

override fun addArgumentResolvers(resolvers: MutableList<HandlerMethodArgumentResolver>) {
resolvers.add(authUserResolver)
}
override fun addCorsMappings(registry: CorsRegistry) {
registry.addMapping("/**")
.allowedOrigins("*")
.allowedMethods("*");
}
}

0 comments on commit 7222ff4

Please sign in to comment.