Crates.io | enrgy |
lib.rs | enrgy |
version | 0.2.2 |
source | src |
created_at | 2021-07-05 20:20:32.205522 |
updated_at | 2021-08-05 06:53:57.165238 |
description | A (nightly) insecure lightweight synchronous Actix-like HTTP server |
homepage | |
repository | https://github.com/Txuritan/enrgy |
max_upload_size | |
id | 419176 |
size | 49,752 |
A (nightly) insecure lightweight synchronous Actix-like HTTP server.
WARNING: Do not allow access to this server from the open internet, it has little to no security measures.
use enrgy::{web, App, HttpServer, Responder};
fn index() -> impl Responder {
"Hello World!"
}
fn greet(name: web::Param<"name">) -> impl Responder {
format!("Hello {}!", *name)
}
fn main() -> Result<(), Box<dyn std::error::Error>> {
HttpServer::new(
App::new()
.service(web::get("/").to(index))
.service(web::get("/:name").to(greet))
)
.bind(("127.0.0.1", 8080))
.run()?;
Ok(())
}
Q: Why the name 'enrgy'?
A: I was trying to come up with a name and miss-spelled energy.