From 582124d59afa438e2cb88cc024d6b19232236e1e Mon Sep 17 00:00:00 2001 From: Melody Horn / boringcactus Date: Sat, 12 Jun 2021 21:06:06 -0600 Subject: stub out basic implementation --- examples/tutorial01/main.rs | 8 ++++---- examples/tutorial01/polls/urls.rs | 2 +- examples/tutorial01/polls/views.rs | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'examples') diff --git a/examples/tutorial01/main.rs b/examples/tutorial01/main.rs index f460e96..3e8f999 100644 --- a/examples/tutorial01/main.rs +++ b/examples/tutorial01/main.rs @@ -3,11 +3,11 @@ use tosin::urls::Path; mod polls; -pub const url_patterns: &[Path] = [ - Path::Include { url: "polls/", content: polls::urls::url_patterns }, - Path::Include { url: "admin/", content: admin::site::urls::url_patterns }, +pub const URL_PATTERNS: &[Path] = &[ + Path::Include { url: "polls/", content: polls::urls::URL_PATTERNS }, + Path::Include { url: "admin/", content: admin::site::urls::URL_PATTERNS }, ]; fn main() { - tosin::run_server(url_patterns); + tosin::run_server(URL_PATTERNS); } diff --git a/examples/tutorial01/polls/urls.rs b/examples/tutorial01/polls/urls.rs index e978920..d56b8c9 100644 --- a/examples/tutorial01/polls/urls.rs +++ b/examples/tutorial01/polls/urls.rs @@ -2,6 +2,6 @@ use tosin::urls::Path; use super::views; -pub const url_patterns: &[Path] = [ +pub const URL_PATTERNS: &[Path] = &[ Path::View { url: "", view: views::index, name: "index" }, ]; diff --git a/examples/tutorial01/polls/views.rs b/examples/tutorial01/polls/views.rs index 8678e97..23b740d 100644 --- a/examples/tutorial01/polls/views.rs +++ b/examples/tutorial01/polls/views.rs @@ -1,5 +1,5 @@ use tosin::http::{Request, Response}; -pub async fn index(request: Request) -> Response { +pub fn index(request: Request) -> Response { Response("Hello, world. You're at the polls index.") } -- cgit v1.2.3