Skip to content

Commit

Permalink
기본 정적리소스 지원, 리소스 핸들러로 커스터마이징 하기
Browse files Browse the repository at this point in the history
  • Loading branch information
namjunemy committed Dec 20, 2018
1 parent 4a7caa2 commit f7b9d05
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
@@ -0,0 +1,16 @@
package io.namjune.springbootconceptandutilization.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class WebConfig implements WebMvcConfigurer {

@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry.addResourceHandler("/m/**")
.addResourceLocations("classpath:/m/")
.setCachePeriod(20);
}
}
2 changes: 1 addition & 1 deletion src/main/resources/application.yml
@@ -1,2 +1,2 @@
server:
port: 0
port: 9090
10 changes: 10 additions & 0 deletions src/main/resources/m/hello.html
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
Hello Mobile static resource!
</body>
</html>
10 changes: 10 additions & 0 deletions src/main/resources/static/hello.html
@@ -0,0 +1,10 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
Hello static resource!
</body>
</html>

0 comments on commit f7b9d05

Please sign in to comment.