(server) chore: Modify Server (#31)

This commit is contained in:
2025-07-14 17:19:30 +08:00
committed by m0_75251201
parent 6ab1b05397
commit 4e7b1ee954
3 changed files with 23 additions and 0 deletions

View File

@ -2,6 +2,7 @@ use std::net::SocketAddr;
use tonic::transport::Server;
use tonic::{Request, Response, Status};
use tonic_web::GrpcWebLayer;
use crate::protocol::game_service_server::{GameService, GameServiceServer};
use crate::protocol::general_service_server::{GeneralService, GeneralServiceServer};
@ -19,6 +20,8 @@ impl GrpcServer {
let game_service = GameServiceServer::new(GameServiceImpl);
Server::builder()
.accept_http1(true)
.layer(GrpcWebLayer::new())
.add_service(general_service)
.add_service(game_service)
.serve(addr)