Skip to content

Commit 26fdce7

Browse files
authored
Merge pull request #1 from ararog/add-examples
ci: removed invalid key
2 parents 6b99197 + f34df2c commit 26fdce7

5 files changed

Lines changed: 71 additions & 5 deletions

File tree

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
name: "🐛 Bug Report"
2-
description: Create a new ticket for a bug.
2+
description: "Create a new ticket for a bug."
33
title: "🐛 [BUG] - <title>"
44
labels: [
55
"bug"
6-
]
6+
]
7+
assignees:
8+
- ararog
9+
body:
10+
- type: markdown
11+
attributes:
12+
value: |
13+
Thanks for taking the time to fill out this bug report!
14+
- type: textarea
15+
id: what-happened
16+
attributes:
17+
label: What happened?
18+
description: Also tell us, what did you expect to happen?
19+
placeholder: Tell us what you see!
20+
value: "A bug happened!"
21+
validations:
22+
required: true
Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
11
name: "🚀 Feature Request"
2-
description: Create a new ticket for a feature request.
2+
description: "Create a new ticket for a feature request."
33
title: "🚀 [FEATURE] - <title>"
44
labels: [
55
"feature",
66
"enhancement"
7-
]
7+
]
8+
assignees:
9+
- ararog
10+
body:
11+
- type: markdown
12+
attributes:
13+
value: |
14+
Thanks for taking the time to fill out this feature request!
15+
- type: textarea
16+
id: what-you-need
17+
attributes:
18+
label: What you need?
19+
description: Describe the feature you need
20+
placeholder: Tell us what you need!
21+
value: "A feature request happened!"
22+
validations:
23+
required: true

Cargo.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
[package]
22
name = "Sophia"
33
version = "0.1.0"
4-
edition = "2024"
4+
edition = "2021"
5+
authors = ["Rogerio Araújo <rogerio.araujo@gmail.com>"]
6+
repository = "https://github.com/ararog/sophia"
7+
homepage = "https://github.com/ararog/sophia"
8+
description = "Very Tiny Server"
9+
readme = "README.md"
10+
license = "MIT"
11+
keywords = ["framework", "backend", "rest-server", "rest"]
12+
publish = true
13+
rust-version = "1.64.0"
514

615
[dependencies]
716
bytes = "1.11.0"

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,29 @@ sophia = { version = "0.1.0", features = ["vetis"] }
2222
- tokio-rt (default)
2323
- smol-rt
2424

25+
## Examples
26+
27+
```rust
28+
use sophia::Sophia;
29+
use http_body_util::{Full};
30+
use bytes::Bytes;
31+
use hyper::Response;
32+
33+
#[tokio::main]
34+
async fn main() -> Result<(), Box<dyn std::error::Error>> {
35+
std_logger::Config::logfmt().init();
36+
37+
let mut sophia = Sophia::new(config);
38+
39+
sophia.serve(|_| async move {
40+
Ok(Response::new(Full::new(Bytes::from("Hello World"))))
41+
}).await?;
42+
43+
Ok(())
44+
}
45+
46+
```
47+
2548
## License
2649

2750
MIT

src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
use std::future::Future;
2+
13
use log::error;
24
use vetis::{RequestType, ResponseType, Vetis, server::{config::ServerConfig, errors::VetisError}};
35

0 commit comments

Comments
 (0)