aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/mod.rs
blob: 87d30512d55380587d1884dd7425fef5a154b256 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use crate::AppState;
use rocket::{catchers, routes, Build, Rocket};
use stream::r_stream;
use ui::error::r_not_found;
use ui::home::r_home;
use ui::node::r_library_node;
use ui::player::r_player;
use ui::style::{r_assets_font, r_assets_style};

pub mod stream;
pub mod ui;

pub fn build_rocket(state: AppState) -> Rocket<Build> {
    rocket::build()
        .manage(state)
        .register("/", catchers![r_not_found])
        .mount(
            "/",
            routes![
                r_home,
                r_library_node,
                r_assets_style,
                r_assets_font,
                r_stream,
                r_player,
            ],
        )
}