The API Gateway is the single entry point for all client traffic in the InnovaTech SOA platform. Every request from the React frontends — whether for catalog browsing, inventory queries, or point-of-sale transactions — arrives here first. The gateway matches the request path against a set of configured routes and forwards it to the appropriate downstream microservice, decoupling clients from individual service addresses and centralizing cross-cutting concerns like CORS policy enforcement.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/Nelsoncg98/InnovaTech/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The gateway is built on Spring Cloud Gateway (Spring Cloud2023.0.1), which uses a fully reactive, non-blocking I/O model powered by Project Reactor and Netty. This makes it well-suited as a perimeter router that can handle high concurrency without dedicating a thread per connection. It runs on port 8080 — the fixed address that all frontend applications are configured to call.
Spring Boot Actuator is included to expose operational endpoints so that infrastructure tooling can verify the gateway’s health and collect metadata without requiring access to application logs.
Port
8080 — all frontend and client traffic targets this port
Spring Cloud Version
2023.0.1 — uses Spring Cloud Gateway (reactive)
Java Version
Java 17 with Spring Boot 3.2.4
Routing Model
Non-blocking, predicate-based path routing
Route Configuration
The gateway defines three named routes inapplication.yml. Each route maps a URL path prefix to a specific downstream service. Requests are forwarded verbatim — the path is not rewritten.
| Route ID | Path Predicate | Upstream URI |
|---|---|---|
ruta-catalogo | /api/v1/catalogo/** | http://localhost:8084 |
ruta-orquestador-pos | /api/v1/ventas-pos/** | http://localhost:8082 |
ruta-inventario | /api/v1/inventario/** | http://localhost:8081 |
application.yml for the gateway is:
CORS Policy
A global CORS configuration is applied to every route ([/**]). This ensures that browser-based clients running on any origin can make cross-origin requests to the gateway without being blocked by the browser’s same-origin policy.
| Setting | Value | Description |
|---|---|---|
allowedOrigins | * | Accepts requests from any origin |
allowedMethods | GET, POST, PUT, DELETE | Standard CRUD HTTP verbs |
allowedHeaders | * | Allows all request headers, including Authorization and Content-Type |
Health & Monitoring
Spring Boot Actuator is configured to expose two management endpoints over HTTP. These can be called by load balancers, container orchestrators, or CI pipelines to verify service availability.| Endpoint | Method | Description |
|---|---|---|
/actuator/health | GET | Returns {"status":"UP"} when the gateway is running normally |
/actuator/info | GET | Returns application metadata defined in management.info.* |
Configuration Reference
The following table lists every configuration property inapplication.yml along with its value and purpose.
| Property | Value | Purpose |
|---|---|---|
server.port | 8080 | Listening port for all inbound traffic |
spring.application.name | api-gateway | Service name used in logs and Actuator info |
spring.cloud.gateway.globalcors.cors-configurations.[/**].allowedOrigins | * | CORS: permitted request origins |
spring.cloud.gateway.globalcors.cors-configurations.[/**].allowedMethods | GET, POST, PUT, DELETE | CORS: permitted HTTP methods |
spring.cloud.gateway.globalcors.cors-configurations.[/**].allowedHeaders | * | CORS: permitted request headers |
routes[0].id | ruta-catalogo | Route identifier for catalog service |
routes[0].uri | http://localhost:8084 | Catalog service upstream address |
routes[0].predicates[0] | Path=/api/v1/catalogo/** | Path predicate for catalog route |
routes[1].id | ruta-orquestador-pos | Route identifier for POS orchestrator |
routes[1].uri | http://localhost:8082 | POS service upstream address |
routes[1].predicates[0] | Path=/api/v1/ventas-pos/** | Path predicate for POS route |
routes[2].id | ruta-inventario | Route identifier for inventory service |
routes[2].uri | http://localhost:8081 | Inventory service upstream address |
routes[2].predicates[0] | Path=/api/v1/inventario/** | Path predicate for inventory route |
management.endpoints.web.exposure.include | health, info | Actuator endpoints exposed over HTTP |