Implements User Authentication and Removes Failed ResourceGuard

This commit is contained in:
2024-02-24 23:42:41 -03:00
parent 077f69778f
commit ff0739573d
15 changed files with 668 additions and 115 deletions

View File

@@ -1,12 +1,12 @@
use crate::handler::health::health_check;
use crate::handler::message::send_message;
use axum::{
routing::{get, post},
Router,
};
use axum::{routing::{get, post}, Router, middleware};
use crate::middleware::auth_middleware::auth_middleware;
pub fn create_route() -> Router {
Router::new()
.route("/health", get(health_check))
.route("/message", post(send_message))
.layer(middleware::from_fn(auth_middleware))
.route("/health", get(health_check))
}