diff options
| author | Fuwn <[email protected]> | 2024-09-05 06:53:51 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-09-05 06:53:51 -0700 |
| commit | 627eadf4871dbba2a506bd9a1327b89f161405b6 (patch) | |
| tree | 327e5148e872e991668ac4454ff64e631161ab04 /src/modules/directory.rs | |
| parent | feat(finger): add july 29, 2024 (diff) | |
| download | locus-627eadf4871dbba2a506bd9a1327b89f161405b6.tar.xz locus-627eadf4871dbba2a506bd9a1327b89f161405b6.zip | |
feat(sitemap): rename to directory
Diffstat (limited to 'src/modules/directory.rs')
| -rw-r--r-- | src/modules/directory.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/modules/directory.rs b/src/modules/directory.rs new file mode 100644 index 0000000..9eddc31 --- /dev/null +++ b/src/modules/directory.rs @@ -0,0 +1,21 @@ +pub fn module(router: &mut windmark::router::Router) { + crate::route::track_mount( + router, + "/directory", + "A map of all publicly available routes on this Gemini capsule", + |context| { + crate::response::success( + &format!( + "# Directory\n\nA map of all publicly available routes on this \ + Gemini capsule\n\n{}", + (*crate::route::ROUTES.lock().unwrap()) + .iter() + .map(|(r, d)| format!("=> {} {}", r, d.description)) + .collect::<Vec<_>>() + .join("\n") + ), + &context, + ) + }, + ); +} |