There was an error while loading. Please reload this page.
2 parents ebb34eb + d46363c commit 71e6a1cCopy full SHA for 71e6a1c
1 file changed
src/main/java/com/swunitzel/fiterview/config/WebConfig.java
@@ -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
18
+ }
19
+}
20
0 commit comments