/*
	Declare routes with middlewares before and after.
	"<route name>" => <method>; <route>; [<array of before middlewares>] => <controller method> => [<array of after middlewares>]
*/
Declare routes with middlewares before and after.
Declare routes with middlewares before and after .
pub fn declare_endpoints(routes: &mut Mount, logger: &Logger) {
	let loggin = LoginMiddleware::new(&logger);
	let salt = GetSaltMiddleware::new(&logger);
	declare_multiple_endpoints!(
		routes, "/", //Declares the main route of the endpoints 
		"ping" => get; "/ping"; [] => TestController::ping => [],
		"read_login_user" => get; "/read_login_user"; [loggin.clone()] => TestController::read_login_user => [],
		"login" => post; "/login"; [salt.clone()] => LoginController::login => [],
		"register" => post; "/register"; [salt.clone()] => LoginController::register => []
	);
	declare_multiple_endpoints!(
		routes, "/user/", //All this endpoints will be inside of the route /user/
		"get_me" => get; "/me"; [loggin.clone()] => UserController::get_me => [],
		"get_user_posts" => get; "/me/post"; [loggin.clone()] => UserController::get_user_posts => [],
		"get_user" => get; "/:id"; [] => UserController::get => [],
		"delete_user" => delete; "/:id"; [] => UserController::delete => [],
		"update_user" => put; "/:id"; [] => UserController::update => []
	);
	declare_multiple_endpoints!(
		routes, "/post/",
		"create_post" => post; "/"; [loggin.clone()] => PostController::create => []
	);
}
pub fn declare_endpoints ( routes : & mut Mount , logger : & Logger ) { let loggin = LoginMiddleware :: new ( & logger ) ; let salt = GetSaltMiddleware :: new ( & logger ) ; declare_multiple_endpoints ! ( routes " " //Declares the main route of the endpoints  " " get " " [ ] TestController ping [ ] " " get " " [ loggin clone ( ) ] TestController read_login_user [ ] " " post " " [ salt clone ( ) ] LoginController login [ ] " " post " " [ salt clone ( ) ] LoginController register [ ] ) ; declare_multiple_endpoints ! ( routes " " //All this endpoints will be inside of the route /user/ " " get " " [ loggin clone ( ) ] UserController get_me [ ] " " get " " [ loggin clone ( ) ] UserController get_user_posts [ ] " " get " " [ ] UserController get [ ] " " delete " " [ ] UserController delete [ ] " " put " " [ ] UserController update [ ] ) ; declare_multiple_endpoints ! ( routes " " " " post " " [ loggin clone ( ) ] PostController create [ ] ) ; }
Declare routes with middlewares before and after.
Declare routes with middlewares before and after .
routes
&mut Mount
logger
&Logger