package cokr.xit.base;

import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.boot.web.server.MimeMappings;
import org.springframework.boot.web.server.WebServerFactoryCustomizer;
import org.springframework.context.annotation.Configuration;

@Configuration
public class ServletCustomizer implements WebServerFactoryCustomizer<TomcatServletWebServerFactory> {
	@Override
    public void customize(TomcatServletWebServerFactory factory) {
        MimeMappings mappings = new MimeMappings(MimeMappings.DEFAULT);
        mappings.add("woff", "font/woff");
        mappings.add("woff2", "font/woff2");
        mappings.add("otf", "font/otf");
        mappings.add("ico", "image/x-icon");
        factory.setMimeMappings(mappings);
    }
}