Skip to content

Instantly share code, notes, and snippets.

@circlee
Created June 29, 2017 07:41
Show Gist options
  • Save circlee/83fd06fbc909468da6233423c27f78ff to your computer and use it in GitHub Desktop.
Save circlee/83fd06fbc909468da6233423c27f78ff to your computer and use it in GitHub Desktop.
resource handler mapping
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("/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