Skip to content

Commit 8a6c9d7

Browse files
committed
added docs.rs commets
1 parent b1eedfa commit 8a6c9d7

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/lib.rs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
//! # Livelocd
2+
//!
3+
//! **Livelocd** is a lightweight Axum-compatible plugin for real-time location tracking using WebSockets.
4+
//!
5+
//! ## Features
6+
//!
7+
//! - Send location updates via WebSocket
8+
//! - Broadcast to all or specific subscribers
9+
//! - Query all users or specific ones via REST
10+
//!
11+
//! ## Usage
12+
//! ```rust
13+
//! use axum::{Router};
14+
//! use livelocd::livelocd_routes;
15+
//!
16+
//! let app = Router::new().merge(livelocd_routes());
17+
//! ```
18+
//!
19+
//! ## WebSocket Endpoints
20+
//!
21+
//! - `GET /ws/send-location`: Send JSON like `{"user_id": "user123", "location": "33.75,-84.38"}`
22+
//! - `GET /ws/subscribe`: Subscribe to all location updates
23+
//! - `GET /ws/subscribe/:user_id`: Subscribe to a single user’s updates
24+
//!
25+
//! ## REST API Endpoints
26+
//!
27+
//! - `GET /api/users`: Get all tracked user locations
28+
//! - `GET /api/users/:user_id`: Get location for a single user
29+
//!
30+
//! ## License
31+
//! MIT © [Bailey Burnsed](https://github.com/Burnsedia)
32+
133
mod handlers;
234
mod state;
335

0 commit comments

Comments
 (0)