Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/wansenai/summer-boot
Summer Boot (async web framework)
https://github.com/wansenai/summer-boot
cargo framework rust web
Last synced: about 7 hours ago
JSON representation
Summer Boot (async web framework)
- Host: GitHub
- URL: https://github.com/wansenai/summer-boot
- Owner: wansenai
- License: apache-2.0
- Created: 2022-05-28T13:43:52.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-15T04:16:11.000Z (7 months ago)
- Last Synced: 2024-11-06T15:06:34.293Z (13 days ago)
- Topics: cargo, framework, rust, web
- Language: Rust
- Homepage: https://crates.io/crates/summer-boot
- Size: 359 KB
- Stars: 128
- Watchers: 12
- Forks: 27
- Open Issues: 17
-
Metadata Files:
- Readme: README.md
- License: LICENSE-APACHE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
Summer Boot
A web framework for Rust
Encapsulating [tide](https://github.com/http-rs/tide), combined with the design principles of spring boot.
will simplify web development and enable developers to focus more on business API development.```rust
summer_boot::log Logger started
summer_boot::log
_____ ____ _
/ ____| | _ \ | |
| (___ _ _ _ __ ___ _ __ ___ ___ _ __ | |_) | ___ ___ | |_
\___ \| | | | '_ ` _ \| '_ ` _ \ / _ \ '__| | _ < / _ \ / _ \| __|
____) | |_| | | | | | | | | | | | __/ | | |_) | (_) | (_) | |_
|_____/ \__,_|_| |_| |_|_| |_| |_|\___|_| |____/ \___/ \___/ \__|
:: Summer Boot Version:: (1.4.2)
summer_boot::server::server Server listening on http://0.0.0.0:8080
```## Quick Start
Cargo.toml:
```rust
summer-boot = "1.4.2"
```Add resuorce configuration file to src directory
src/resources/application.yml
```yml
profiles:
active: test
```
src/resources/application-test.yml
```yml
server:
port: 8080
context_path: /
```src/main.rs
```rust
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
- [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0)
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsummer-os%2Fsummer-boot.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsummer-os%2Fsummer-boot?ref=badge_large)