https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api
POC para conectar um api simples em uma api-gateway e se registrarem num service-registry
https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api
api-gateway eureka-client eureka-server java17-spring-boot rest-api service-registry spring-cloud-gateway spring-cloud-netflix
Last synced: 3 months ago
JSON representation
POC para conectar um api simples em uma api-gateway e se registrarem num service-registry
- Host: GitHub
- URL: https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api
- Owner: pauloruszel
- Created: 2024-06-18T21:14:17.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-06-18T22:23:34.000Z (over 1 year ago)
- Last Synced: 2025-06-28T18:45:06.522Z (6 months ago)
- Topics: api-gateway, eureka-client, eureka-server, java17-spring-boot, rest-api, service-registry, spring-cloud-gateway, spring-cloud-netflix
- Language: Java
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# π API Gateway, Service Registry e Simple Service API



POC de exemplo que demonstra a integraΓ§Γ£o de um API Gateway, um Service Registry (Eureka) e um serviΓ§o simples usando Spring Boot e Spring Cloud.
## Estrutura do Projeto
api-gateway-service-registry-simple-service-api
```bash
β
βββ pom.xml
βββ api-gateway
β βββ pom.xml
βββ service-registry-api
β βββ pom.xml
βββ simple-service-api
βββ pom.xml
```
## PrΓ©-requisitos
- [Java 17](https://adoptopenjdk.net/)
- [Maven 3.6.3+](https://maven.apache.org/)
- [IntelliJ IDEA](https://www.jetbrains.com/idea/)
### Clonando o RepositΓ³rio:
```bash
git clone https://github.com/pauloruszel/api-gateway-service-registry-simple-service-api.git
```
## π οΈ Construindo o Projeto
```bash
cd api-gateway-service-registry-simple-service-api
mvn clean install
```
1. Service Registry (Eureka)
```bash
mvn -pl service-registry-api spring-boot:run
```
β¨ Acesse o Eureka Dashboard em http://localhost:8761
2. Simple Service API
```bash
mvn -pl simple-service-api spring-boot:run
```
3. API Gateway
```bash
mvn -pl api-gateway spring-boot:run
```
β¨ Acesse o serviΓ§o atravΓ©s do Gateway em http://localhost:8080/simple-service-api/hello
## π Estrutura de Pastas
```bash
api-gateway-service-registry-simple-service-api
βββ api-gateway
β βββ src/main/java/com/br/api/gateway/ApiGatewayApplication.java
β βββ src/main/resources/application.yml
β βββ pom.xml
βββ service-registry-api
β βββ src/main/java/com/br/service/registry/ServiceRegistryApplication.java
β βββ src/main/resources/application.yml
β βββ pom.xml
βββ simple-service-api
βββ src/main/java/com/br/simple/service/SimpleServiceApplication.java
βββ src/main/java/com/br/simple/service/HelloWorldController.java
βββ src/main/resources/application.yml
βββ pom.xml
```
## βοΈ Tecnologias e bibliotecas usadas
- `Java 17`
- `Spring Boot 3.3`
- `Spring Cloud 2023.0.2`
- `Maven 3.6.3`