summer-boot

Crates.iosummer-boot
lib.rssummer-boot
version1.4.2
sourcesrc
created_at2022-06-23 17:32:38.550565
updated_at2023-12-27 12:46:45.994062
descriptionsummer boot
homepagehttps://crates.io/crates/summer-boot
repositoryhttps://github.com/wansenai/summer-boot
max_upload_size
id611978
size162,576
James Zow (Jzow)

documentation

https://github.com/wansenai/summer-boot#readme

README

Summer Boot

Bors enabled FOSSA Status

The next generation decentralized web framework allows users to manage and share their own data. It will be a wide area and cross regional web framework.

summer_boot::log Logger started
summer_boot::log 
    _____                                       ____              _   
   / ____|                                     |  _ \            | |  
  | (___  _   _ _ __ ___  _ __ ___   ___ _ __  | |_) | ___   ___ | |_ 
   \___ \| | | | '_ ` _ \| '_ ` _ \ / _ \ '__| |  _ < / _ \ / _ \| __|
   ____) | |_| | | | | | | | | | | |  __/ |    | |_) | (_) | (_) | |_ 
  |_____/ \__,_|_| |_| |_|_| |_| |_|\___|_|    |____/ \___/ \___/ \__|
                                                                      
  :: Summer Boot Version::             (1.4.2)                                                                    
 
summer_boot::web2::server::server Server listening on http://0.0.0.0:8080

Quick Start

Cargo.toml:

summer-boot = "1.4.2"

Add resuorce configuration file to src directory

src/resources/application.yml

profiles:
  active: test

src/resources/application-test.yml

server:
  port: 8080

src/main.rs

use serde::Deserialize;
use summer_boot::{Request, Result};
use summer_boot::log;

#[derive(Debug, Deserialize)]
struct User {
    name: String,
    age: u16,
}

#[summer_boot::auto_scan]
#[summer_boot::main]
async fn main() {
    summer_boot::run();
}

#[summer_boot::post("/test/api")]
async fn test_api(mut req: Request<()>) -> Result {
    let User { name, age } = req.body_json().await?;
    Ok(format!("Hello, {}!  {} years old", name, age).into())
}

License

Licensed under either of

FOSSA Status

Commit count: 258

cargo fmt