use anyhow::Result;
use crate::{gateway, project};
pub fn gateway() -> Result<()> {
let root = project::find_root()?;
if gateway::install(&root)? {
println!(
"Gateway installed. Route apps with `slave make:app <name> --domain <host>` or `--path </prefix>`,"
);
println!(
"then `slave build gateway` (compiling Pingora needs CMake and takes a while the first time)."
);
} else {
println!("The gateway is already installed ({}/).", gateway::DIR);
}
Ok(())
}