diff --git a/src/controller/mod.rs b/src/controller/mod.rs index ff5f4c294753c0d336c158f03d8da16f52c4cb82..96b57a419583902586780daac64123ca92b7efec 100644 --- a/src/controller/mod.rs +++ b/src/controller/mod.rs @@ -5,6 +5,6 @@ use rocket::fairing::AdHoc; pub fn route_stage() -> AdHoc { return AdHoc::on_ignite("Initializing controller routes...", |rocket| async { rocket - .mount("/", routes![notification::subscribe, notification::unsubscribe, notification::receive]) + .mount("/", routes![notification::subscribe, notification::unsubscribe, notification::receive, notification::list]) }); } diff --git a/src/controller/notification.rs b/src/controller/notification.rs index 1b7e27bbef3b8f484eed7086e1e9712618bf659f..cc7b42766297f2f85f1d3839d7378fd257d79f33 100644 --- a/src/controller/notification.rs +++ b/src/controller/notification.rs @@ -27,4 +27,12 @@ pub fn receive(notification: Json<Notification>) -> Result<Json<Notification>> { Ok(f) => Ok(Json::from(f)), Err(e) => Err(e) }; +} + +#[get("/")] +pub fn list() -> Result<Json<Vec<String>>> { + return match NotificationService::list_message() { + Ok(f) => Ok(Json::from(f)), + Err(e) => Err(e) + } } \ No newline at end of file