Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use anyhow::Result;
use salvo::prelude::*;

pub fn routes() -> Router {
    Router::new().push(Router::with_path("/robots.txt").get(get_robots_txt))
}

#[handler]
fn get_robots_txt(res: &mut Response) -> Result<()> {
    res.render(Text::Plain(
        r#"
User-agent: *
Disallow: /healthcheck
"#,
    ));

    Ok(())
}