parent
234458e11c
commit
1cf099845b
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,2 @@
|
|||||||
|
[default]
|
||||||
|
template_dir = "templates"
|
@ -1,11 +1,19 @@
|
|||||||
#[macro_use] extern crate rocket;
|
#[macro_use] extern crate rocket;
|
||||||
|
|
||||||
|
use rocket_dyn_templates::{Template, context};
|
||||||
|
|
||||||
#[get("/")]
|
#[get("/")]
|
||||||
fn index() -> &'static str {
|
fn index() -> Template {
|
||||||
"Hello, world!"
|
Template::render("index", context! {
|
||||||
|
challenge: 114,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[launch]
|
#[launch]
|
||||||
fn rocket() -> _ {
|
fn rocket() -> _ {
|
||||||
rocket::build().mount("/", routes![index])
|
let config = rocket::Config::figment()
|
||||||
|
.merge(("port", 1313));
|
||||||
|
rocket::custom(config)
|
||||||
|
.mount("/", routes![index])
|
||||||
|
.attach(Template::fairing())
|
||||||
}
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Tegaki Tuesday</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Welcome to Tegaki Tuesday #{{ challenge }}!</h1>
|
||||||
|
</body>
|
||||||
|
</html>
|
Loading…
Reference in new issue