Initial commit

This commit is contained in:
root
2025-09-14 13:07:54 +05:00
commit 1daae73939
18 changed files with 1102 additions and 0 deletions
BIN
View File
Binary file not shown.
@@ -0,0 +1,13 @@
package konturai.kz.api_gateway;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class ApiGatewayApplication {
public static void main(String[] args) {
SpringApplication.run(ApiGatewayApplication.class, args);
}
}
+44
View File
@@ -0,0 +1,44 @@
server:
port: 80 # Стандартный HTTP порт для шлюза
spring:
application:
name: api-gateway
cloud:
gateway:
routes:
# Маршрут для сервиса Parser (ВЫСОКИЙ ПРИОРИТЕТ)
- id: parser-service
uri: http://parser-service:8080
predicates:
- Path=/api/parser/**
filters:
- StripPrefix=2 # Убираем /api/parser
order: 1 # <-- Высокий приоритет
# Маршрут по умолчанию для Core сервиса (НИЗКИЙ ПРИОРИТЕТ)
- id: core-service-fallback
uri: http://core-service:8080
predicates:
- Path=/** # <-- Матчится со всеми путями
order: 100 # <-- Низкий приоритет (сработает последним)
# CORS конфигурация для поддержки кросс-доменных запросов
globalcors:
corsConfigurations:
'[/**]':
allowedOrigins: '*'
allowedMethods:
- GET
- POST
- PUT
- DELETE
- OPTIONS
allowedHeaders: '*'
allowCredentials: true
# Логирование для отладки маршрутизации
logging:
level:
'[org.springframework.cloud.gateway]': DEBUG
'[org.springframework.web.reactive]': DEBUG
@@ -0,0 +1,13 @@
package konturai.kz.api_gateway;
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;
@SpringBootTest
class ApiGatewayApplicationTests {
@Test
void contextLoads() {
}
}