-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from Jzow/master
v1.0.0 update and add doc
- Loading branch information
Showing
20 changed files
with
129 additions
and
70 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,21 @@ | ||
[package] | ||
name = "summer-boot-autoconfigure" | ||
version = "0.1.2" | ||
version = "1.0.0" | ||
rust-version = "1.60.0" | ||
edition = "2021" | ||
description = "summer boot autoconfigure" | ||
authors = [ | ||
"James Zow <[email protected]>" | ||
"James Zow <[email protected]>", | ||
"Xinyu Gao", | ||
"Summeros Team <[email protected]>" | ||
] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
keywords = ["middleware", "autoconfigure", "summer"] | ||
documentation = "https://github.com/summer-os/summer-boot/summer-boot-autoconfigure/#readme" | ||
repository = "https://github.com/summer-os/summer-boot" | ||
homepage = "https://summeros.io/" | ||
|
||
|
||
[dependencies] | ||
serde = { version = "1", features = ["derive"] } | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# Summer Boot AutoConfigure | ||
|
||
Implementation of automatic configuration for summer boot, At present, there is an implementation of reading YML files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,19 @@ | ||
[package] | ||
name = "summer-boot-macro" | ||
version = "0.1.2" | ||
version = "1.0.0" | ||
rust-version = "1.60.0" | ||
edition = "2021" | ||
description = "summer boot macro" | ||
license = "Apache-2.0" | ||
authors = [ | ||
"James Zow <[email protected]>", | ||
"Yangandmore <[email protected]>" | ||
"Yangandmore <[email protected]>", | ||
"Summeros Team <[email protected]>" | ||
] | ||
|
||
readme = "README.md" | ||
documentation = "https://github.com/summer-os/summer-boot/blob/master/summer-boot-macro/README.md" | ||
repository = "https://github.com/summer-os/summer-boot" | ||
homepage = "https://summeros.io/" | ||
|
||
[lib] | ||
proc-macro = true | ||
|
@@ -21,7 +25,7 @@ syn = { version = "1.0", features = ["full"] } | |
toml = "0.5" | ||
serde = { version = "1", features = ["derive"] } | ||
serde_json = "1" | ||
summer-boot-autoconfigure = { version = "0.1.2", path = "../summer-boot-autoconfigure" } | ||
summer-boot-autoconfigure = { version = "1.0.0", path = "../summer-boot-autoconfigure" } | ||
|
||
[dev-dependencies] | ||
summer-boot = { version = "0.1.2", path = "../summer-boot" } | ||
summer-boot = { version = "1.0.0", path = "../summer-boot" } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,19 @@ | ||
[package] | ||
name = "summer-boot" | ||
version = "0.1.3" | ||
version = "1.0.0" | ||
rust-version = "1.60.0" | ||
edition = "2021" | ||
description = "summer boot web2" | ||
description = "summer boot" | ||
authors = [ | ||
"James Zow <[email protected]>" | ||
"James Zow <[email protected]>", | ||
"Summeros Team <[email protected]>" | ||
] | ||
license = "Apache-2.0" | ||
readme = "README.md" | ||
keywords = ["tcp", "http", "web2", "web3", "summer"] | ||
documentation = "https://github.com/summer-os/summer-boot#readme" | ||
repository = "https://github.com/summer-os/summer-boot" | ||
homepage = "https://summeros.io/" | ||
|
||
[features] | ||
default = ["macros"] | ||
|
@@ -39,7 +45,7 @@ futures-util = "0.3.6" | |
|
||
|
||
# summer dependencies | ||
summer-boot-macro = { version = "0.1.2", path = "../summer-boot-macro", optional = true } | ||
summer-boot-macro = { version = "1.0.0", path = "../summer-boot-macro", optional = true } | ||
|
||
#log | ||
femme = { version = "2.1.1"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# Summer Boot | ||
|
||
<a href="https://app.bors.tech/repositories/45710"><img src="https://bors.tech/images/badge_small.svg" alt="Bors enabled"></a> | ||
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fsummer-os%2Fsummer-boot.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fsummer-os%2Fsummer-boot?ref=badge_shield) | ||
|
||
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. | ||
|
||
```rust | ||
summer_boot::log Logger started | ||
summer_boot::log | ||
_____ ____ _ | ||
/ ____| | _ \ | | | ||
| (___ _ _ _ __ ___ _ __ ___ ___ _ __ | |_) | ___ ___ | |_ | ||
\___ \| | | | '_ ` _ \| '_ ` _ \ / _ \ '__| | _ < / _ \ / _ \| __| | ||
____) | |_| | | | | | | | | | | | __/ | | |_) | (_) | (_) | |_ | ||
|_____/ \__,_|_| |_| |_|_| |_| |_|\___|_| |____/ \___/ \___/ \__| | ||
|
||
:: Summer Boot Version:: (1.0.0) | ||
|
||
summer_boot::web2::server::server Server listening on http://127.0.0.1:8080 | ||
``` | ||
|
||
## Quick Start | ||
|
||
Cargo.toml: | ||
```rust | ||
summer-boot = "1.0.0" | ||
``` | ||
|
||
Add resuorce configuration file to src directory | ||
|
||
src/resources/application.yml | ||
```yml | ||
profiles: | ||
active: test | ||
|
||
``` | ||
src/resources/application-test.yml | ||
```yml | ||
server: | ||
port: 8080 | ||
``` | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
pub mod endpoint; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
mod accept; | ||
pub mod server; | ||
pub mod ssl; | ||
pub mod endpoint; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod ssl; |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters