diff --git a/src/main.rs b/src/main.rs index 83fee98..f900c6e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,12 +3,24 @@ use rocket::{get, routes}; mod markdown; use markdown::{Markdown, MarkdownConvertError}; +type MarkdownResult = Result; + #[get("/")] -fn index() -> Result { - include_str!("../static/hello-world.md").parse() +fn index() -> MarkdownResult { + one() +} + +#[get("/1")] +fn one() -> MarkdownResult { + include_str!("../static/page1.md").parse() +} + +#[get("/2")] +fn two() -> MarkdownResult { + include_str!("../static/page2.md").parse() } #[shuttle_runtime::main] async fn main() -> shuttle_rocket::ShuttleRocket { - Ok(rocket::build().mount("/", routes![index]).into()) + Ok(rocket::build().mount("/", routes![index, one, two]).into()) } diff --git a/static/hello-world.md b/static/hello-world.md deleted file mode 100644 index 9f735a6..0000000 --- a/static/hello-world.md +++ /dev/null @@ -1 +0,0 @@ -

Hello, world!

diff --git a/static/page1.md b/static/page1.md new file mode 100644 index 0000000..56dc321 --- /dev/null +++ b/static/page1.md @@ -0,0 +1 @@ +Wrong page! Go to [page2](2). diff --git a/static/page2.md b/static/page2.md new file mode 100644 index 0000000..dab69e9 --- /dev/null +++ b/static/page2.md @@ -0,0 +1 @@ +Wrong page! Go to [page1](1).