Skip to content

Commit 71e6a1c

Browse files
Merge pull request #54 from SWUNITZEL/feat/#44-kakao-oauth2
Feat: index.html 반환 관련 설정
2 parents ebb34eb + d46363c commit 71e6a1c

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
package com.swunitzel.fiterview.config;
2+
3+
import org.springframework.context.annotation.Configuration;
4+
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
5+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
6+
7+
@Configuration
8+
public class WebConfig implements WebMvcConfigurer {
9+
10+
@Override
11+
public void addViewControllers(ViewControllerRegistry registry) {
12+
// 모든 경로를 index.html로 포워딩. 단, /api로 시작하는 경로는 제외
13+
registry.addViewController("/{path:^(?!api|static).*$}")
14+
.setViewName("forward:/");
15+
// 루트 경로도 index.html로 포워딩
16+
registry.addViewController("/")
17+
.setViewName("forward:/");
18+
}
19+
}
20+

0 commit comments

Comments
 (0)