Skip to content

Commit

Permalink
Merge pull request #28 from Basicprogrammer10/dev
Browse files Browse the repository at this point in the history
afire 2.0.0
  • Loading branch information
connorslade authored Feb 11, 2023
2 parents 9d1dd37 + 5ee44df commit 95c22c3
Show file tree
Hide file tree
Showing 74 changed files with 4,456 additions and 3,175 deletions.
6 changes: 6 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"name": "afire",
"image": "mcr.microsoft.com/devcontainers/rust:1-buster",
"postCreateCommand": "git submodule update --init --recursive",
"forwardPorts": [8080]
}
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 9 additions & 24 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,28 @@
[package]
name = "afire"
version = "1.2.0"
authors = ["Connor Slade <connor@connorcode.com>"]
edition = "2018"
name = "afire"
version = "2.0.0"

repository = "https://github.com/Basicprogrammer10/afire"
homepage = "https://connorcode.com/writing/afire"
documentation = "https://docs.rs/afire"
categories = ["network-programming", "web-programming::http-server"]
description = "πŸ”₯ A blazing fast web framework for Rust"
documentation = "https://docs.rs/afire"
exclude = [".github/", "SocialShare.*", ".devcontainer"]
homepage = "https://connorcode.com/writing/afire"
keywords = ["afire", "http", "WebFramework", "WebServer"]
categories = ["network-programming", "web-programming::http-server"]
exclude = [".github/", "SocialShare.*"]
license = "MIT"
readme = "README.md"
repository = "https://github.com/Basicprogrammer10/afire"

[lib]
name = "afire"
path = "lib/lib.rs"

[features]
default = [
"cookies",
"panic_handler",
"path_patterns",
"dynamic_resize",
"path_decode_url"
]

# Default On
cookies = []
panic_handler = []
path_patterns = []
dynamic_resize = []
path_decode_url = []
default = ["tracing"]

# Other
extensions = []
tracing = []

[dev-dependencies]
# Enable rate_limit and logging features for examples
afire = { path = ".", features = ["extensions", "tracing"] }
afire = { path = ".", features = ["extensions"] }
62 changes: 54 additions & 8 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,49 @@
# 2.0.0

February 11, 2023

- Fix improper URL decoding behavior
- Improve Memory Usage On `Request`s
- Internal code cleanup
- More clear info on IO errors
- Make SocketAddr accessible from Request
- Remade social share image
- Let ServeStatic::new take in strings and paths (previously only strings)
- Remove unnecessary feature flags (cookies, path_patterns, dynamic_resize, path_decode_url)
- More clear info on IO errors
- Improve Memory Usage On `Request`s
- Less cloning internally
- Make SocketAddr accessible from Request
- New error types: Startup / Stream
- Date middleware in extensions
- Another middleware rewrite
- Util module
- All Content variants use charset=utf-8 by default
- HeaderType enum
- Status enum
- New Header methods
- New Query methods
- Encoding module
- Server::new accepts ToHostAddress (Ipv4Addr, String, &str, [u8; 4])
- Rewrote socket handler (this is a big one)
- Trace system
- Streaming response
- Socket keep-alive!
- Request modifier
- Error handler has app state
- Panic if no app state and stateful routes
- Documentation of internal structs
- Fix improper URL decoding behavior
- Internal code cleanup
- Remade social share image
- Let ServeStatic::new take in strings and paths (previously only strings)
- Rewrote lots of documentation with spelling fixes and better code examples
- Remove unnecessary feature flags (cookies, path_patterns, dynamic_resize, path_decode_url)
- Removed cache extension
- Removed socket handler struct (don't think it was ever used)
- Removed the buff_size field from server, its handled automatically now
- Removed `set_run` on the server, its no longer needed internally

# 1.2.0

June 24, 2022
Expand All @@ -18,12 +64,12 @@ June 24, 2022
- Add Cache Middleware
- Remove insane build script
- When building http response only add Content-Length and default headers if they are not already present
- Add server state syste
- Add server state system
- Improved Request Parsing
- Redo Error system
- Remove the requests raw_data feild
- Remove the requests raw_data felid
- Remove Request::body_string in favor of String::from_utf8()
- Fix HTTP parseing and genatation issues
- Fix HTTP parsing and generation issues

# 1.1.0

Expand Down Expand Up @@ -84,7 +130,7 @@ Jan 25, 2022 s
- Remove thread pool from project (for now)
- Make Custom Content Type use &str not String
- Make VERSION Public
- Add External Unit Testsremove_address_port
- Add External Unit Tests remove_address_port
- Use the built-in `IpAddr` enum for server Ip
- Remove `.ip_string()` for `.ip.to_string()`
- Add `Response.close()` for closing a stream with no response
Expand Down Expand Up @@ -119,7 +165,7 @@ Dec 04, 2021
- Rename `add_default_header` to `default_header`
- Store Raw Request data and Request body as `Vec<u8>`
- Fix Panic Handler feature compile problems
- Dont use an Option for Vec of default headers
- Don't use an Option for Vec of default headers
- Fix Header Parsing
- Add a `header` method on Request to get headers

Expand Down Expand Up @@ -149,7 +195,7 @@ Oct 27, 2021
- Start / Start Threaded returns Option
- Add .unwrap to all server.starts in examples
- Add http.rs to move raw http parsing out of server.rs
- Dont give up on cookie parsing if cookie header is malformed
- Don't give up on cookie parsing if cookie header is malformed
- Add optional Socket Timeout
- Add Socket Timeout Docs

Expand Down Expand Up @@ -196,7 +242,7 @@ Sep 17, 2021
Sep 05, 2021

- Allow responding with bytes, not just strings
- Add Serving Favoricon as example thing
- Add Serving Favicon as example thing

# 0.1.3

Expand All @@ -216,7 +262,7 @@ Sep 01, 2021
Aug 31, 2021

- Add Optional Rate limiter _beta_
- Update readme abit
- Update readme a bit
- Copy new readme to lib.rs
- Add internal docs to Ratelimit
- Add Optional Logger _beta_
Expand Down
17 changes: 8 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,35 @@
# πŸ”₯ afire <a href="https://github.com/Basicprogrammer10/afire/actions"><img src="https://img.shields.io/github/workflow/status/Basicprogrammer10/afire/CI?label=Tests"></a> <a href="#"><img src="https://img.shields.io/tokei/lines/github/Basicprogrammer10/afire?label=Total%20Lines"></a> <a href="https://crates.io/crates/afire"><img alt="Crates.io" src="https://img.shields.io/crates/v/afire"> <img src="https://img.shields.io/crates/d/afire?label=Downloads"></a>
# πŸ”₯ afire <a href="https://github.com/Basicprogrammer10/afire/actions"><img src="https://github.com/Basicprogrammer10/afire/actions/workflows/rust.yml/badge.svg"></a> <a href="https://crates.io/crates/afire"><img alt="Crates.io" src="https://img.shields.io/crates/v/afire"> <img src="https://img.shields.io/crates/d/afire?label=Downloads"></a>

afire is a _blazing fast_ web server micro framework for rust.
afire is a _blazingly fast_ web server micro framework for rust.

## πŸ’  Install

Just add the following to your `Cargo.toml`:

```toml
[dependencies]
afire = "1.2.0"
afire = "2.0.0"
```

## πŸ“„ Info

afire is a simple synchronous multithreaded express.js inspired rust web micro framework.
wow that was long.
It comes with some built extensions in for Static File Serving, Rate limiting, more.
It comes with some built extensions in for Static File Serving, Rate limiting, and more.

Below you can fine links to some afire related resources.

- [Homepage](https://connorcode.com/writing/afire)
- [Crates.io page](https://crates.io/crates/afire)
- [API Docs](https://docs.rs/afire/latest/afire/)
- [Homepage](https://connorcode.com/writing/afire)

## πŸ’₯ Example

For more examples see the examples directory [here](https://github.com/Basicprogrammer10/afire/tree/main/examples).

Below is a super simple example so you can see the basics of aire syntax.
Below is a super simple example so you can see the basics of afire syntax.

```rust
```rust no_run
// Import Lib
use afire::{Server, Method, Response, Header, Content};

Expand All @@ -38,7 +38,7 @@ let mut server = Server::<()>::new("localhost", 8080);

// Add a route
server.route(Method::GET, "/greet/{name}", |req| {
let name = req.path_param("name").unwrap();
let name = req.param("name").unwrap();

Response::new()
.text(format!("Hello, {}", name))
Expand All @@ -47,7 +47,6 @@ server.route(Method::GET, "/greet/{name}", |req| {

// Start the server
// This is blocking
# server.set_run(false);
server.start().unwrap();
```

Expand Down
Loading

0 comments on commit 95c22c3

Please sign in to comment.