pub mod axum;
pub mod builder;
pub mod standalone;
use std::net::SocketAddr;
#[derive(Debug, Clone)]
pub struct ServerConfig {
pub addr: SocketAddr,
pub name: String,
pub max_connections: u32,
pub tls: bool,
}
impl Default for ServerConfig {
fn default() -> Self {
Self {
addr: "0.0.0.0:8080".parse().unwrap(),
name: "sunbeam-server".to_string(),
max_connections: 1000,
tls: false,
}
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_server_config_default() {
let config = ServerConfig::default();
assert_eq!(config.addr, "0.0.0.0:8080".parse().unwrap());
assert_eq!(config.name, "sunbeam-server");
assert_eq!(config.max_connections, 1000);
assert!(!config.tls);
}
}