Skip to content

Commit

Permalink
webconfig 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
minseok1015 committed Aug 19, 2024
1 parent ed272bc commit b2378ff
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/main/java/store/itpick/backend/config/WebConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;


import java.util.List;

Expand Down Expand Up @@ -54,6 +56,17 @@ public void addCorsMappings(CorsRegistry registry) {
.allowCredentials(true);
}

@Override
public void addViewControllers(ViewControllerRegistry registry) {
// 모든 경로에서 index.html을 반환하도록 설정
registry.addViewController("/{spring:\\w+}")
.setViewName("forward:/index.html");
registry.addViewController("/**/{spring:\\w+}")
.setViewName("forward:/index.html");
registry.addViewController("/{spring:\\w+}/**{spring:?!(\\.js|\\.css|\\.png|\\.jpg)$}")
.setViewName("forward:/index.html");
}




Expand Down

0 comments on commit b2378ff

Please sign in to comment.