Skip to main content

fraiseql_core/config/
server.rs

1//! Server-specific configuration.
2
3use serde::{Deserialize, Serialize};
4
5/// Server-specific configuration.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7#[serde(default)]
8pub struct CoreServerConfig {
9    /// Host to bind to.
10    pub host: String,
11
12    /// Port to bind to.
13    pub port: u16,
14
15    /// Number of worker threads (0 = auto).
16    pub workers: usize,
17
18    /// Request body size limit in bytes.
19    pub max_body_size: usize,
20
21    /// Enable request logging.
22    pub request_logging: bool,
23}
24
25impl Default for CoreServerConfig {
26    fn default() -> Self {
27        Self {
28            host:            "0.0.0.0".to_string(),
29            port:            8000,
30            workers:         0,           // Auto-detect
31            max_body_size:   1024 * 1024, // 1MB
32            request_logging: true,
33        }
34    }
35}