Created
June 29, 2017 07:55
-
-
Save circlee/bdfcdc31f59920d4e9a3e3da242ccd88 to your computer and use it in GitHub Desktop.
resource handler mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.springframework.context.annotation.Configuration; | |
import org.springframework.web.servlet.config.annotation.CorsRegistry; | |
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry; | |
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter; | |
@Configuration | |
public class MvcConfig extends WebMvcConfigurerAdapter { | |
@Override | |
public void addResourceHandlers(ResourceHandlerRegistry registry) { | |
registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/dist/static/"); | |
registry.addResourceHandler("/index.html").addResourceLocations("classpath:/static/dist/index.html"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment