diff options
Diffstat (limited to 'src/routes/api/mod.rs')
-rw-r--r-- | src/routes/api/mod.rs | 89 |
1 files changed, 47 insertions, 42 deletions
diff --git a/src/routes/api/mod.rs b/src/routes/api/mod.rs index 05c9ec0..e6f41e5 100644 --- a/src/routes/api/mod.rs +++ b/src/routes/api/mod.rs @@ -11,6 +11,7 @@ mod communities; mod forgot_password; mod media; mod posts; +mod stable; mod users; lazy_static::lazy_static! { @@ -158,51 +159,55 @@ enum RespThingInfo<'a> { } pub fn route_api() -> crate::RouteNode<()> { - crate::RouteNode::new().with_child( - "unstable", - crate::RouteNode::new() - .with_child( - "actors:lookup", - crate::RouteNode::new().with_child_str( - crate::RouteNode::new().with_handler_async("GET", route_unstable_actors_lookup), - ), - ) - .with_child( - "logins", - crate::RouteNode::new() - .with_handler_async("POST", route_unstable_logins_create) - .with_child( - "~current", + crate::RouteNode::new() + .with_child( + "unstable", + crate::RouteNode::new() + .with_child( + "actors:lookup", + crate::RouteNode::new().with_child_str( crate::RouteNode::new() - .with_handler_async("GET", route_unstable_logins_current_get) - .with_handler_async("DELETE", route_unstable_logins_current_delete), + .with_handler_async("GET", route_unstable_actors_lookup), ), - ) - .with_child("media", media::route_media()) - .with_child( - "nodeinfo/2.0", - crate::RouteNode::new().with_handler_async("GET", route_unstable_nodeinfo_20_get), - ) - .with_child("communities", communities::route_communities()) - .with_child( - "instance", - crate::RouteNode::new() - .with_handler_async("GET", route_unstable_instance_get) - .with_handler_async("PATCH", route_unstable_instance_patch), - ) - .with_child( - "misc", - crate::RouteNode::new().with_child( - "render_markdown", + ) + .with_child( + "logins", crate::RouteNode::new() - .with_handler_async("POST", route_unstable_misc_render_markdown), - ), - ) - .with_child("posts", posts::route_posts()) - .with_child("comments", comments::route_comments()) - .with_child("users", users::route_users()) - .with_child("forgot_password", forgot_password::route_forgot_password()), - ) + .with_handler_async("POST", route_unstable_logins_create) + .with_child( + "~current", + crate::RouteNode::new() + .with_handler_async("GET", route_unstable_logins_current_get) + .with_handler_async("DELETE", route_unstable_logins_current_delete), + ), + ) + .with_child("media", media::route_media()) + .with_child( + "nodeinfo/2.0", + crate::RouteNode::new() + .with_handler_async("GET", route_unstable_nodeinfo_20_get), + ) + .with_child("communities", communities::route_communities()) + .with_child( + "instance", + crate::RouteNode::new() + .with_handler_async("GET", route_unstable_instance_get) + .with_handler_async("PATCH", route_unstable_instance_patch), + ) + .with_child( + "misc", + crate::RouteNode::new().with_child( + "render_markdown", + crate::RouteNode::new() + .with_handler_async("POST", route_unstable_misc_render_markdown), + ), + ) + .with_child("posts", posts::route_posts()) + .with_child("comments", comments::route_comments()) + .with_child("users", users::route_users()) + .with_child("forgot_password", forgot_password::route_forgot_password()), + ) + .with_child("stable", stable::route_stable()) } async fn insert_token( |