Skip to content
/ enrgy Public

An lightweight synchronous Actix-like HTTP server

Notifications You must be signed in to change notification settings

Txuritan/enrgy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

enrgy

A (nightly) 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.

Q: Why does this exist?

A: I needed a lightweight actix-web like server library, I also wanted to mess around with unstable features.

About

An lightweight synchronous Actix-like HTTP server

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages