| Crates.io | ribs |
| lib.rs | ribs |
| version | 1.4.1 |
| created_at | 2025-10-21 19:14:57.156251+00 |
| updated_at | 2025-10-31 15:56:31.001398+00 |
| description | RIBS is a tool that allows to create a Rust Internet Basic Server |
| homepage | |
| repository | https://gitlab.com/Benoit_V/crate_rust_internet_basic_server |
| max_upload_size | |
| id | 1894306 |
| size | 18,827 |
Ribs helps you to set a minimal web server to start a new project in a second.
cargo init
cargo add ribs axum tokio --features tokio/full
ENV=development
HOST=127.0.0.1
LOG_LEVEL=debug
PORT=3000
others options are : ENV = development | production HOST = any valid IP address LOG_LEVEL = error | warn | info | debug | trace PORT = any valid port number between 1024 and 65535
add the following code to your main.rs file:
use ribs::prelude::*;
use axum::{Router, routing::get, response::Html};
#[tokio::main]
async fn main() -> Result<(), ServerError> {
let config = ServerConfig::from_env()?;
let router = Router::new()
.route("/", get(home));
start_server(config, router).await
}
async fn home() -> Html<&'static str> {
Html("<h1>Hello World!</h1>")
}
to run the server, use the following command:
cargo run
# -> Server running at http://127.0.0.1:3000