4 releases
0.2.2 | Aug 5, 2021 |
---|---|
0.2.1 | Jul 6, 2021 |
0.2.0 | Jul 6, 2021 |
0.1.0 | Jul 5, 2021 |
#832 in HTTP server
50KB
1.5K
SLoC
enrgy
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.
Example
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(())
}
FAQ
Q: Why the name 'enrgy'?
A: I was trying to come up with a name and miss-spelled energy.
Dependencies
~1.9–8.5MB
~80K SLoC