Files
server/src/main.rs
T
2025-12-21 14:43:48 +01:00

28 lines
542 B
Rust

mod cli;
mod macros;
mod plugin;
mod requests;
mod server;
mod types;
mod utils;
use std::path::PathBuf;
use server::ServerConfig;
use utils::vfs;
pub use anyhow::Context as ErrorContext;
pub use anyhow::Result;
pub use once_cell;
fn main() -> Result<()> {
let root = PathBuf::from("");
let config: ServerConfig = if let Ok(env_config) = std::env::var("VX_CONFIG") {
ServerConfig::from_str(&env_config)?
} else {
vfs::read_config(&root.join("config.json"))?
};
config.build(&root).run()?;
Ok(())
}