gateway actually works

This commit is contained in:
hirst 2024-05-27 15:58:42 +02:00
parent 8e3bba298f
commit c02b24e766
2 changed files with 3 additions and 16 deletions

View file

@ -3,10 +3,11 @@ package com.learningpulse.gateway;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient; import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.security.config.annotation.web.reactive.EnableWebFluxSecurity;
@EnableDiscoveryClient
@SpringBootApplication @SpringBootApplication
@EnableWebFluxSecurity
@EnableDiscoveryClient
public class GatewayApplication { public class GatewayApplication {
public static void main(String[] args) { public static void main(String[] args) {

View file

@ -1,14 +0,0 @@
package com.learningpulse.gateway;
import org.springframework.context.annotation.Bean;
import org.springframework.web.servlet.function.RouterFunction;
import org.springframework.web.servlet.function.ServerResponse;
import static org.springframework.web.servlet.function.RouterFunctions.route;
import static org.springframework.cloud.gateway.server.mvc.handler.HandlerFunctions.http;
public class SimpleGateway {
@Bean
public RouterFunction<ServerResponse> getRoute() {
return route().GET("/get", http("https://httpbin.org")).build();
}
}