summaryrefslogtreecommitdiff
path: root/src/routes.rs
diff options
context:
space:
mode:
authorKit La Touche <kit@transneptune.net>2025-07-02 16:34:33 -0400
committerKit La Touche <kit@transneptune.net>2025-07-23 16:38:55 -0400
commitc21eb26c8d011932293aeec3afe4849740f7fdf8 (patch)
treed77c92b31dff49e6151d3b2ade851b12a88ad437 /src/routes.rs
parentaec3eaeebd37bce9ab4dad14e7e86ef0db8f0c2d (diff)
Rough in client and server side of web-push
Diffstat (limited to 'src/routes.rs')
-rw-r--r--src/routes.rs9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/routes.rs b/src/routes.rs
index 6993070..293dae3 100644
--- a/src/routes.rs
+++ b/src/routes.rs
@@ -4,7 +4,7 @@ use axum::{
routing::{delete, get, post},
};
-use crate::{app::App, boot, conversation, event, expire, invite, message, setup, ui, user};
+use crate::{app::App, boot, conversation, event, expire, invite, message, setup, push, ui, user};
pub fn routes(app: &App) -> Router<App> {
// UI routes that can be accessed before the administrator completes setup.
@@ -23,7 +23,12 @@ pub fn routes(app: &App) -> Router<App> {
.route_layer(crate::setup::Required(app.clone()).with_fallback(Redirect::to("/setup")));
// API routes that can run before the administrator completes setup.
- let api_bootstrap = Router::new().route("/api/setup", post(setup::handlers::setup));
+ let api_bootstrap = Router::new()
+ .route("/api/setup", post(setup::handlers::setup))
+ .route("/api/vapid", get(push::handlers::vapid))
+ .route("/api/register", post(push::handlers::register))
+ .route("/api/unregister", post(push::handlers::unregister))
+ .route("/api/echo", post(push::handlers::echo));
// API routes that require the administrator to complete setup first.
let api_setup_required = Router::new()