Skip to content

Commit

Permalink
Task 19 : Revise ProductserviceApplication and Define GatewayConfig w…
Browse files Browse the repository at this point in the history
…ith its Java Doc
  • Loading branch information
Rapter1990 committed Jul 15, 2024
1 parent 26178bc commit ce3d9c2
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.springbootmicroservices.apigateway.config;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
* Configuration class named {@link GatewayConfig} for setting up API Gateway routes.
*/
@Configuration
public class GatewayConfig {

/**
* Configures the route locator to define the routing rules for the gateway.
*
* @param builder The RouteLocatorBuilder used to build the RouteLocator.
* @return A RouteLocator with the defined routes.
*/
@Bean
public RouteLocator routes(RouteLocatorBuilder builder) {

return builder.routes()
.route("productservice", r -> r.path("/api/v1/products/**")
.uri("lb://productservice"))
.build();

}

}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;

/**
* The entry point for the Commonservice Spring Boot application.
* The entry point for the Product service Spring Boot application.
* This application is a Eureka client that registers itself with a Eureka server.
* The application is configured with the {@link SpringBootApplication} annotation.
*/
Expand Down

0 comments on commit ce3d9c2

Please sign in to comment.