From 7447a411f0dc4c9eff4cfaf28c1171ca1b4be707 Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sun, 13 Jun 2021 10:42:17 -0600 Subject: add structure for settings --- examples/tutorial01/main.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'examples/tutorial01') 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()); -- cgit v1.2.3