aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorMelody Horn / boringcactus <melody@boringcactus.com>2021-06-13 10:42:17 -0600
committerMelody Horn / boringcactus <melody@boringcactus.com>2021-06-13 10:42:17 -0600
commit7447a411f0dc4c9eff4cfaf28c1171ca1b4be707 (patch)
tree125b36165e8010b95aa97aa70bfc088dc370b3ac /examples
parent109966b7e365423bce83b78004eb1c21b7892940 (diff)
downloadtosin-7447a411f0dc4c9eff4cfaf28c1171ca1b4be707.tar.gz
tosin-7447a411f0dc4c9eff4cfaf28c1171ca1b4be707.zip
add structure for settings
Diffstat (limited to 'examples')
-rw-r--r--examples/tutorial01/main.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/examples/tutorial01/main.rs b/examples/tutorial01/main.rs
index 62c32cd..4db9897 100644
--- a/examples/tutorial01/main.rs
+++ b/examples/tutorial01/main.rs
@@ -1,16 +1,21 @@
+use tosin::Settings;
use tosin::contrib::admin;
use tosin::http::Filter;
use tosin::urls::{UrlMap, path};
mod polls;
-pub fn urls() -> UrlMap {
+fn urls() -> UrlMap {
path!("polls" / ..).and(polls::urls::urls())
.or(path!("admin" / ..).and(admin::site::urls::urls()))
.unify()
.boxed()
}
-fn main() {
- tosin::run_server(urls());
+fn settings() -> Settings {
+ Settings {
+ ..Settings::default()
+ }
}
+
+tosin::main!(urls(), settings());