heart

Crates.ioheart
lib.rsheart
version
sourcesrc
created_at2024-11-18 14:41:33.439345
updated_at2024-11-30 00:44:24.055223
descriptionHypermedia-based web development of the 1990 future!
homepagehttps://github.com/luciusmagn/heart
repositoryhttps://github.com/luciusmagn/heart
max_upload_size
id1452245
Cargo.toml error:TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Lukáš Hozda [magnusi] (luciusmagn)

documentation

README

Heart

A Rust-based web stack combining powerful libraries for building modern, efficient web applications.

Components

  • Warp: High-performance HTTP server with filter-based routing
  • Maud: Compile-time HTML templating
  • HTMX: Modern web interactions without complex JavaScript
  • TiKV: Distributed, strongly consistent key-value store

Installation

Add to your Cargo.toml:

[dependencies]
heart = "0.1.20"

Example

use tokio;
use heart::prelude::*;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    tracing_subscriber::fmt::init();

    let route = warp::path("hello")
        .map(|| {
            let markup = html! {
                h1 { "Hello, Heart Stack!" }
                p { "This is a tiny example." }
            };

            info!("Serving hello route");

            Response::builder()
                .header("Content-Type", "text/html")
                .body(markup.into_string())
        });

    info!("Starting server on http://localhost:3030");
    warp::serve(route)
        .run(([127, 0, 0, 1], 3030))
        .await;
    Ok(())
}

Contributions

Contributions are welcome! Please follow Kant's categorical imperative.

License

Fair License (2024)

Copyright (c) 2024 Lukáš Hozda

Usage of the software is PERMITTED, modification and redistribution are PERMITTED, 
however all versions of the derived code MUST be clearly marked as such 
and NOT represented as the original software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND.
Commit count: 33

cargo fmt