diff --git a/src/controllers/routes.rs b/src/controllers/routes.rs index 396d466..b7a1447 100644 --- a/src/controllers/routes.rs +++ b/src/controllers/routes.rs @@ -32,10 +32,22 @@ pub struct Route { pub func: RequestProcess, } +impl Route { + + pub fn get_without_login(uri: &'static str, func: RequestProcess) -> Route { + Route { + method: GET, + need_login: false, + uri, + func + } + } +} + /// Get the list of routes available pub fn get_routes() -> Vec { vec![ // Server meta routes - Route { method: GET, uri: "/", need_login: false, func: Box::new(server_controller::main_index) } + Route::get_without_login("/", Box::new(server_controller::main_index)) ] } \ No newline at end of file