Crates.io | juri |
lib.rs | juri |
version | 0.4.0-alpha.3 |
source | src |
created_at | 2022-08-10 15:12:05.60199 |
updated_at | 2023-01-09 15:02:00.716691 |
description | http service |
homepage | https://github.com/luoxiaozero/juri |
repository | https://github.com/luoxiaozero/juri |
max_upload_size | |
id | 642683 |
size | 87,814 |
HTTP Framework
Please refer to Juri Document
cargo add juri
cargo add async-std
use juri::{Request, Response, Router, handler};
use std::net::SocketAddr;
#[handler]
fn handle_index(_request: &Request) -> juri::Result<Response> {
Ok(Response::html("Hello Juri"))
}
#[juri::main]
async fn main() {
let mut router = Router::new();
router.at("/").get(handle_index);
let addr = SocketAddr::from(([127, 0, 0, 1], 7878));
juri::Server::bind(addr).server(router).await.unwrap();
}
MIT License