Copied from api_gateway, removed REST handlers (port 8080), added tonic-web + CORS for grpc-web browser access. Binary renamed: api-gateway → api Changes: - Package name: api-gateway → api - Deleted src/handlers/ (REST ML endpoints on port 8080) - Added tonic-web 0.13 + tower-http CORS layer - Server::builder().accept_http1(true) for grpc-web - CORS_ORIGINS env var (default http://localhost:5173) - Metrics server on port 9091 (axum) preserved - All 95 lib tests pass, 0 clippy warnings - Added services/api to workspace members Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
41 lines
1.5 KiB
Rust
41 lines
1.5 KiB
Rust
//! gRPC modules for API Gateway
|
|
//!
|
|
//! This module contains gRPC handlers and proxies for backend services:
|
|
//! - Trading Service (zero-copy proxy, <10us routing overhead)
|
|
//! - Backtesting Service (zero-copy proxy)
|
|
//! - ML Training Service (zero-copy proxy)
|
|
//! - Trading Agent Service (zero-copy proxy)
|
|
//! - Monitoring Service (direct Prometheus handler)
|
|
|
|
pub mod backtesting_proxy;
|
|
pub mod broker_gateway_proxy;
|
|
pub mod config_proxy;
|
|
pub mod data_acquisition_proxy;
|
|
pub mod ml_proxy;
|
|
pub mod ml_trading_proxy;
|
|
pub mod ml_training_proxy;
|
|
pub mod monitoring_handler;
|
|
pub mod pods_handler;
|
|
pub mod risk_proxy;
|
|
pub mod server;
|
|
pub mod trading_agent_proxy;
|
|
pub mod trading_direct_proxy;
|
|
pub mod trading_proxy;
|
|
|
|
pub use backtesting_proxy::BacktestingServiceProxy;
|
|
pub use broker_gateway_proxy::BrokerGatewayProxy;
|
|
pub use config_proxy::ConfigServiceProxy;
|
|
pub use data_acquisition_proxy::DataAcquisitionProxy;
|
|
pub use ml_proxy::MlServiceProxy;
|
|
pub use ml_trading_proxy::MlTradingProxy;
|
|
pub use ml_training_proxy::MlTrainingProxy;
|
|
pub use monitoring_handler::MonitoringServiceHandler;
|
|
pub use risk_proxy::RiskServiceProxy;
|
|
pub use server::{
|
|
setup_ml_training_client, setup_ml_training_proxy, setup_trading_agent_client,
|
|
setup_trading_agent_proxy, MlTrainingBackendConfig, TradingAgentBackendConfig,
|
|
};
|
|
pub use trading_agent_proxy::TradingAgentProxy;
|
|
pub use trading_direct_proxy::TradingDirectProxy;
|
|
pub use trading_proxy::{BackendHealthState, HealthChecker, ServiceHealthEntry, TradingServiceProxy};
|