Maintenance

sauron

Latest Version Build Status MIT licensed

sauron

Sauron is a versatile web framework and library for building client-side and/or server-side web applications with strong focus on simplicity. It is suited for developing web application which uses progressive rendering.

Counter example

In your src/lib.rs ```rust use sauron::html::text; use sauron::prelude::*; use sauron::{node, Cmd, Application, Node, Program};

[derive(Debug)]

pub enum Msg { Increment, Decrement, }

pub struct App { count: i32, }

impl App { pub fn new() -> Self { App { count: 0 } } }

impl Application for App { fn view(&self) -> Node { node! {

{text(self.count)}
} }

fn update(&mut self, msg: Msg) -> Cmd<Self, Msg> {
    match msg {
        Msg::Increment => self.count += 1,
        Msg::Decrement => self.count -= 1,
    }
    Cmd::none()
}

}

[wasm_bindgen(start)]

pub fn main() { Program::mounttobody(App::new()); } `index.html` html Counter `` InCargo.toml, specify the crate-type to becdylib`

```toml [package] name = "counter" version = "0.1.0" edition = "2018"

[lib] crate-type = ["cdylib"]

[dependencies] sauron = "0.41" ```

Build using sh $> wasm-pack build --target web --release Explore some other examples on this repo.

Demo examples

Prerequisite:

sh cargo install wasm-pack cargo install basic-http-server

License: MIT