2016-04-01 23:54:53 +00:00
|
|
|
#![feature(plugin)]
|
2016-09-09 03:38:58 +00:00
|
|
|
#![plugin(rocket_codegen)]
|
2016-12-29 16:41:23 +00:00
|
|
|
|
2016-04-01 23:54:53 +00:00
|
|
|
extern crate rocket;
|
|
|
|
|
2016-12-29 16:41:23 +00:00
|
|
|
#[cfg(test)] mod tests;
|
|
|
|
|
2016-04-01 23:54:53 +00:00
|
|
|
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() {
|
2016-10-04 02:48:33 +00:00
|
|
|
rocket::ignite().mount("/", routes![root, login]).launch();
|
2016-04-01 23:54:53 +00:00
|
|
|
}
|