2016-04-01 23:54:53 +00:00
|
|
|
#![feature(plugin)]
|
|
|
|
#![plugin(rocket_macros)]
|
|
|
|
extern crate rocket;
|
|
|
|
|
|
|
|
use rocket::Rocket;
|
|
|
|
use rocket::response::Redirect;
|
|
|
|
|
2016-09-04 11:06:28 +00:00
|
|
|
#[get("/")]
|
2016-04-01 23:54:53 +00:00
|
|
|
fn root() -> Redirect {
|
|
|
|
Redirect::to("/login")
|
|
|
|
}
|
|
|
|
|
2016-09-04 11:06:28 +00:00
|
|
|
#[get("/login")]
|
2016-04-01 23:54:53 +00:00
|
|
|
fn login() -> &'static str {
|
|
|
|
"Hi! Please log in before continuing."
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
Rocket::new("localhost", 8000).mount_and_launch("/", routes![root, login]);
|
|
|
|
}
|