org.openwms.tms.routing.app.RoutingWebConfiguration Maven / Gradle / Ivy
The newest version!
package org.openwms.tms.routing.app;
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.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
@Configuration
public class RoutingWebConfiguration implements WebMvcConfigurer {
@Override
public void addViewControllers(ViewControllerRegistry registry) {
registry.addViewController("/ui/").setViewName("forward:/ui/index.html");
}
@Override
public void addResourceHandlers(ResourceHandlerRegistry registry) {
registry
.addResourceHandler("/ui/**")
.addResourceLocations("classpath:/META-INF/resources/");
}
@Override
public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**");
}
}