Rocket/examples/redirect/src/main.rs

23 lines
364 B
Rust
Raw Normal View History

#![feature(plugin)]
2016-09-09 03:38:58 +00:00
#![plugin(rocket_codegen)]
2016-12-29 16:41:23 +00:00
extern crate rocket;
2016-12-29 16:41:23 +00:00
#[cfg(test)] mod tests;
use rocket::response::Redirect;
2016-09-04 11:06:28 +00:00
#[get("/")]
fn root() -> Redirect {
Redirect::to("/login")
}
2016-09-04 11:06:28 +00:00
#[get("/login")]
fn login() -> &'static str {
"Hi! Please log in before continuing."
}
fn main() {
rocket::ignite().mount("/", routes![root, login]).launch();
}