美文网首页
vue项目路由history模式下,springboot配置

vue项目路由history模式下,springboot配置

作者: dongzhensong | 来源:发表于2020-05-17 23:17 被阅读0次
public static void main(String[] args) {
         SpringApplication application = new SpringApplication(BackApplication.class);
         context = application.run();

    }

    @Bean
    public WebServerFactoryCustomizer<ConfigurableWebServerFactory> webServerFactoryCustomizer(){
        return new WebServerFactoryCustomizer<ConfigurableWebServerFactory>() {
            @Override
            public void customize(ConfigurableWebServerFactory factory) {
//                factory.setPort(8081);
                ErrorPage error404Page = new ErrorPage(HttpStatus.NOT_FOUND, "/index.html");
                Set<ErrorPage> errorPages = new HashSet<>();
                errorPages.add(error404Page);
                factory.setErrorPages(errorPages);
            }
        };
    }

相关文章

网友评论

      本文标题:vue项目路由history模式下,springboot配置

      本文链接:https://www.haomeiwen.com/subject/npaeohtx.html