Simple notification http server
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

get notification body/title

+15 -3
+1
Cargo.lock
··· 1103 1103 dependencies = [ 1104 1104 "actix-web", 1105 1105 "notify-rust", 1106 + "serde", 1106 1107 ] 1107 1108 1108 1109 [[package]]
+1
Cargo.toml
··· 6 6 [dependencies] 7 7 actix-web = "4.12.0" 8 8 notify-rust = "4.11.7" 9 + serde = "1.0.228"
+13 -3
src/main.rs
··· 1 - use actix_web::{App, HttpResponse, HttpServer, Responder, post}; 1 + use actix_web::{App, HttpResponse, HttpServer, Responder, post, web}; 2 + use serde::Deserialize; 3 + 4 + #[derive(Deserialize)] 5 + struct NotificationData { 6 + name: String, 7 + body: String, 8 + } 2 9 3 10 #[post("/notify")] 4 - async fn notify() -> impl Responder { 5 - HttpResponse::InternalServerError().body("TODO: implement") 11 + async fn notify(notification: web::Form<NotificationData>) -> impl Responder { 12 + HttpResponse::InternalServerError().body(format!( 13 + "TODO: implement ({}: {})", 14 + notification.name, notification.body 15 + )) 6 16 } 7 17 8 18 #[actix_web::main]