whoi is a web application built with Rust and the Axum framework. It provides real-time CPU usage data and serves static files.
The project uses the following dependencies:
axumfor web server and routingtokiofor asynchronous runtimesysinfofor system informationserde_jsonfor JSON serializationcomrakfor Markdown parsing
- Rust and Cargo installed. You can install them from rustup.rs.
-
Clone the repository:
git clone <repository-url> cd whoi
-
Build the project:
cargo build
-
Run the project:
cargo run
-
Open your browser and navigate to
http://localhost:7032to see the application.
The main entry point of the application. It sets up the routes and starts the server.
root_get: Serves theindex.htmlfile.indexmjs_get: Serves theindex.mjsfile.indexcss_get: Serves theindex.cssfile.realtime_cpus_get: Upgrades to a WebSocket connection and streams real-time CPU usage data.
The main HTML file that includes the JavaScript and CSS files.
The JavaScript module that handles the WebSocket connection and updates the CPU usage data on the webpage.
The CSS file for styling the webpage.
This project is licensed under the MIT License.