package com.whyc;
|
|
//import com.spring4all.swagger.EnableSwagger2Doc;
|
|
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.web.servlet.ServletComponentScan;
|
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
|
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
|
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
|
|
/**
|
* @Description : 启动类
|
* @date 2020/10/15
|
**/
|
@SpringBootApplication
|
@EnableWebMvc
|
@ServletComponentScan(basePackages = "com.whyc.filter")
|
public class Application extends WebMvcConfigurerAdapter implements WebMvcConfigurer {
|
|
public static void main(String[] args) {
|
SpringApplication.run(Application.class,args);
|
}
|
|
@Override
|
public void addResourceHandlers(ResourceHandlerRegistry registry) {
|
//super.addResourceHandlers(registry);
|
//registry.addResourceHandler("/**").addResourceLocations("/");
|
registry.addResourceHandler("doc.html").addResourceLocations("classpath:/META-INF/resources/");
|
registry.addResourceHandler("/webjars/**").addResourceLocations("classpath:/META-INF/resources/webjars/");
|
}
|
|
}
|