aboutsummaryrefslogtreecommitdiff
path: root/server/src/routes/mod.rs
blob: 332b4c51413fd1cc98d28e6647b00e5a97d62efb (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
29
30
31
32
33
34
use crate::AppState;
use rocket::{catchers, routes, Build, Rocket};
use stream::r_stream;
use ui::account::{r_account_login, r_account_register, r_account_register_post};
use ui::error::r_not_found;
use ui::home::r_home;
use ui::node::{r_item_assets, r_library_node};
use ui::player::r_player;
use ui::style::{r_assets_font, r_assets_js, 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_assets_js,
                r_stream,
                r_player,
                r_account_login,
                r_account_register,
                r_account_register_post,
                r_item_assets,
            ],
        )
}