修改默认路由为404
package com.twqc.config;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.http.HttpStatus;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.ServerResponse;
import static org.springframework.web.reactive.function.server.RequestPredicates.GET;
import static org.springframework.web.reactive.function.server.RouterFunctions.route;
/**
* @author scott
* @date 2020/05/26
* 路由配置信息
*/
@Slf4j
@Configuration
public class GatewayRoutersConfiguration {
/**
* 修改默认路由,将原来的跳转到接口文档地址改成展示404。访问接口文档地址为:http://***:9999/jeecg-gateway/doc.html#/home
*
* @return
*/
@Bean
public RouterFunction<ServerResponse> indexRouter() {
return route(GET("/"), request -> ServerResponse.status(HttpStatus.NOT_FOUND).build());
}
}