rupring

Crates.iorupring
lib.rsrupring
version0.14.1
created_at2023-10-10 15:56:21.652799+00
updated_at2025-09-21 16:02:07.965502+00
descriptionSpring Comes to Rust
homepagehttps://github.com/myyrakle/rupring/blob/master/README.md
repositoryhttps://github.com/myyrakle/rupring
max_upload_size
id999257
size250,718
myyrakle (myyrakle)

documentation

https://docs.rs/rupring/latest/rupring

README

rupring

GitHub license

Spring Comes to Rust

Get Started

required dependency list

rupring = "0.14.1"
serde = { version="1.0.193", features=["derive"] }

And you can write your server like this:

#[derive(Debug, Clone, Copy)]
#[rupring::Module(controllers=[HomeController{}], modules=[])]
pub struct RootModule {}

#[derive(Debug, Clone)]
#[rupring::Controller(prefix=/, routes=[hello, echo])]
pub struct HomeController {}

#[rupring::Get(path = /)]
pub fn hello(_request: rupring::Request) -> rupring::Response {
    rupring::Response::new().text("Hello, World!".to_string())
}

#[rupring::Get(path = /echo)]
pub fn echo(request: rupring::Request) -> rupring::Response {
    rupring::Response::new().text(request.body)
}

fn main() {
    rupring::run(RootModule {})
}

And if you run the program, it will work fine.
hello_world

More Details

Please refer to the documentation for more details.

Commit count: 612

cargo fmt