Some practice with frontend and Axum.
web_htop
is a service built with Axum and Rust that provides real-time monitoring of CPU load via HTTP and WebSockets. The project aims to demonstrate frontend technologies and Rust's async capabilities.
- Fetch current CPU load via HTTP
- Real-time CPU load monitoring through WebSockets
- Easy to understand, idiomatic Rust code
- Rust and Cargo
- Basic understanding of HTTP and WebSockets
git clone https://github.com/qqrm/web_htop.git
cd web_htop
To compile the project, navigate to the project directory and run:
cargo build
To start the service, run:
cargo run
Your service will start and listen at http://0.0.0.0:8081
.
To fetch the current CPU load via HTTP, execute the following command:
curl http://localhost:8081/api/cpus
For real-time monitoring of CPU load, connect to the WebSocket endpoint using a WebSocket client:
ws://localhost:8081/rt/cpus
- Thanks to the Rust community for the language and ecosystem
- The Axum and Tokio teams for their robust libraries