~vpzom/lotide

ref: a180781e02e14910f367bf2c704b84103e84b8c2 lotide/src/routes/mod.rs -rw-r--r-- 590 bytes
a180781e — Colin Reeder Include score and optionally your_vote in every post list (#109) 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
mod api;
mod apub;
mod well_known;

pub fn route_root() -> crate::RouteNode<()> {
    crate::RouteNode::new()
        .with_handler_async("GET", |_, _, req| {
            let lang = crate::get_lang_for_req(&req);
            futures::future::err(crate::Error::UserError(crate::simple_response(
                hyper::StatusCode::METHOD_NOT_ALLOWED,
                lang.tr("root", None).into_owned(),
            )))
        })
        .with_child("apub", apub::route_apub())
        .with_child("api", api::route_api())
        .with_child(".well-known", well_known::route_well_known())
}