aboutsummaryrefslogtreecommitdiff
path: root/examples/tutorial02/main.rs
blob: c6620014e90c603c914b95ed97f9f6f20b01804c (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
use tosin::Settings;
use tosin::contrib::admin;
use tosin::urls::{UrlMap, url_map};

mod polls;

fn urls() -> UrlMap {
    url_map! {
        "polls" / ..polls::urls(),
        "admin" / ..admin::site::urls(),
    }
}

fn settings() -> Settings {
    Settings {
        installed_apps: &[
            &polls::APP,
            &admin::APP,
        ],
        database_url: "example_data.sqlite3",
        ..Settings::default()
    }
}

tosin::main!(urls(), settings());