diff --git a/src/controller/mod.rs b/src/controller/mod.rs index b1d8df3d48fedcaf5843728fe18632a21cb8d6db..a55bc154c1c1df012fc6a1a833a0b0bc7f7d7271 100644 --- a/src/controller/mod.rs +++ b/src/controller/mod.rs @@ -6,6 +6,6 @@ pub fn route_stage() -> AdHoc { return AdHoc::on_ignite("Initializing controller routes...", |rocket| async { rocket .mount("/", routes![notification::subscribe, notification::unsubscribe, - notification::receive]) + notification::receive, notification::list]); }); } diff --git a/src/controller/notification.rs b/src/controller/notification.rs index bc64944ba1e84649c90c8fc0c43c45a0fa1a1642..790386b88e088998d7d1eca1e03347b135fea914 100644 --- a/src/controller/notification.rs +++ b/src/controller/notification.rs @@ -29,3 +29,10 @@ pub fn receive(notification: Json<Notification>) -> Result<Json<Notification>> { }; } +#[get("/")] +pub fn list() -> Result<Json<Vec<String>>> { + return match NotificationService::list_messages() { + Ok(f) => Ok(Json::from(f)), + Err(e) => Err(e) + }; +}