codemp/src/server/main.rs

30 lines
557 B
Rust
Raw Normal View History

//! # codemp Server
//!
//! The codemp server itself, in charge of handling the global state, merging operations from
//! all clients and synching everyone's cursor.
//!
mod buffer;
use tracing::info;
2022-07-10 19:01:56 +02:00
use tonic::transport::Server;
use crate::buffer::service::BufferService;
2022-07-10 19:01:56 +02:00
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
tracing_subscriber::fmt::init();
let addr = "[::1]:50051".parse()?;
info!("Starting server");
2022-07-10 19:01:56 +02:00
Server::builder()
.add_service(BufferService::new().server())
.serve(addr)
.await?;
2022-07-10 19:01:56 +02:00
Ok(())
2022-07-10 19:01:56 +02:00
}