(config: &Config)
| 18 | use rocket::{get, response::content::RawHtml, routes, Route, State}; |
| 19 | |
| 20 | pub fn external_routes(config: &Config) -> Vec<Route> { |
| 21 | let mut routes = routes![index]; |
| 22 | if config.app_compose.public_logs { |
| 23 | routes.extend(routes![get_logs]); |
| 24 | } |
| 25 | if config.app_compose.public_sysinfo { |
| 26 | routes.extend(routes![metrics]); |
| 27 | } |
| 28 | routes |
| 29 | } |
| 30 | |
| 31 | #[get("/")] |
| 32 | async fn index(state: &State<AppState>) -> Result<RawHtml<String>, String> { |