Simple HTTP 2.0 library for building APIs
Httiple aims to make HTTP/2 over TLS in rust simple. It adopts a Express-like interface.
cargo new myserver
Add an index.html and a certificate in the main folder. Name the certificate folder "ca".
Add this to your Cargo.toml
[dependencies]
httimple = "*"
Make a file containing this and name it main.rs. ``` extern crate httimple;
use httimple::app::App;
use httimple::app::message::Message; use httimple::app::call::Call;
use httimple::helpers::file;
fn main() { let mut app = App::new(); app.serve("/", | call: &Call | -> Message { Message::from(file("index.html")) }); app.start(); } ```
cargo run --release