- add: handle channel list request

- add: handle server select request
- add: handle character list request stub
- add: start health check function for consul
This commit is contained in:
2024-12-13 04:40:07 -05:00
parent 1220d7a031
commit 38ea2ddb71
9 changed files with 133 additions and 49 deletions

View File

@@ -1,19 +1,19 @@
use std::collections::HashMap;
use auth_service::auth::auth_service_server::AuthServiceServer;
use auth_service::database_client::DatabaseClient;
use auth_service::database_client::DatabaseClientTrait;
use auth_service::grpc::MyAuthService;
use dotenv::dotenv;
use std::collections::HashMap;
use std::env;
use std::net::ToSocketAddrs;
use std::str::FromStr;
use tokio::{select, signal};
use tonic::transport::Server;
use tracing::{info, Level};
use tracing::log::debug;
use warp::Filter;
use tracing::{info, Level};
use utils::consul_registration;
use utils::service_discovery::get_service_address;
use warp::Filter;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
@@ -54,10 +54,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
.await?;
// Start health-check endpoint
let health_route = warp::path!("health")
.map(|| warp::reply::with_status("OK", warp::http::StatusCode::OK));
tokio::spawn(warp::serve(health_route).run(health_check_endpoint_addr.to_socket_addrs()?.next().unwrap()));
consul_registration::start_health_check(addr.as_str()).await?;
let db_address = db_nodes.get(0).unwrap();
let db_url = format!("http://{}:{}", db_address.ServiceAddress, db_address.ServicePort);