Skip to content

Prepare 0.3.0 release #339

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Oct 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
497 changes: 58 additions & 439 deletions CHANGELOG.md

Large diffs are not rendered by default.

14 changes: 5 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[package]
name = "tide"
version = "0.3.0"
description = "Serve the web – HTTP server framework"
authors = [
"Aaron Turon <[email protected]>",
"Yoshua Wuyts <[email protected]>",
]
description = "WIP modular web framework"
documentation = "https://docs.rs/tide"
keywords = ["tide", "http", "web", "framework", "async"]
categories = [
Expand All @@ -13,10 +15,8 @@ categories = [
]
edition = "2018"
license = "MIT OR Apache-2.0"
name = "tide"
readme = "README.md"
repository = "https://github.com/rustasync/tide"
version = "0.2.0"
repository = "https://github.com/http-rs/tide"

[dependencies]
cookie = { version = "0.12.0", features = ["percent-encode"] }
Expand Down Expand Up @@ -47,6 +47,7 @@ version = "0.16.1"
[features]
default = ["hyper"]
hyper = ["http-service-hyper"]
unstable = []

[dev-dependencies]
basic-cookies = "0.1.3"
Expand All @@ -60,8 +61,3 @@ mime_guess = "2.0.1"
percent-encoding = "2.1.0"
serde = { version = "1.0.102", features = ["derive"] }
structopt = "0.3.3"

[patch.crates-io]
http-service = { git = "https://github.com/rustasync/http-service", branch = "master" }
http-service-hyper = { git = "https://github.com/rustasync/http-service", branch = "master" }
http-service-mock = { git = "https://github.com/rustasync/http-service", branch = "master" }
31 changes: 4 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<h1 align="center">Tide</h1>
<div align="center">
<strong>
Empowering everyone to build HTTP Services.
Serve the web
</strong>
</div>

Expand All @@ -13,11 +13,6 @@
<img src="https://img.shields.io/crates/v/tide.svg?style=flat-square"
alt="Crates.io version" />
</a>
<!-- Build Status -->
<a href="https://travis-ci.org/rustasync/tide">
<img src="https://img.shields.io/travis/rustasync/tide.svg?style=flat-square"
alt="Build Status" />
</a>
<!-- Downloads -->
<a href="https://crates.io/crates/tide">
<img src="https://img.shields.io/crates/d/tide.svg?style=flat-square"
Expand Down Expand Up @@ -46,14 +41,8 @@
</h3>
</div>

<div align="center">
<sub>Built with 🌊 by <a href="https://github.com/rustasync">The Rust Async Ecosystem WG</a>
</div>

## About

A modular web framework built around async/await. It's actively being developed by the Rust Async
Ecosystem WG, and **not ready for production use yet**.
A modular web framework built around async/await. It's actively being developed
and **not ready for production use yet**.

## Examples

Expand All @@ -64,7 +53,7 @@ Ecosystem WG, and **not ready for production use yet**.

fn main() -> Result<(), std::io::Error> {
let mut app = tide::App::new();
app.at("/").get(async move |_| "Hello, world!");
app.at("/").get(|_| async move { "Hello, world!" });
Ok(app.serve("127.0.0.1:8000")?)
}
```
Expand All @@ -89,18 +78,6 @@ Read about the design here:
- [Middleware in Tide](https://rustasync.github.io/team/2018/11/07/tide-middleware.html)
- [Tide's evolving middleware approach](https://rustasync.github.io/team/2018/11/27/tide-middleware-evolution.html)

### Supported Rust Versions

Tide is built against the latest Rust nightly releases and as such, due to it's use of `std` futures,
it has the following specific breakpoints that align with std future API changes:

| Tide | Rust |
| ----------- | ----------------------- |
| &le; v0.1.0 | &le; nightly-2019-04-07 |
| &ge; v0.1.1 | &ge; nightly-2019-04-08 |

_**Note:** Since these are due to changes in `std`, projects with dependencies that use conflicting versions of `std::futures` will not build successfully._

## Contributing

Want to join us? Check out our [The "Contributing" section of the
Expand Down
2 changes: 1 addition & 1 deletion examples/default_headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ fn main() {
.header("X-Server", "Tide"),
);

app.at("/").get(|_| async move {"Hello, world!"});
app.at("/").get(|_| async move { "Hello, world!" });

app.serve("127.0.0.1:8000").unwrap();
}
2 changes: 1 addition & 1 deletion examples/hello.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
fn main() {
let mut app = tide::App::new();
app.at("/").get(|_| async move {"Hello, world!" });
app.at("/").get(|_| async move { "Hello, world!" });
app.serve("127.0.0.1:8000").unwrap();
}
2 changes: 1 addition & 1 deletion examples/staticfile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ impl StaticFile {
}
};

let mime = mime_guess::guess_mime_type(path);
let mime = mime_guess::from_path(path).first_or_octet_stream();
let mime_str = mime.as_ref();
let size = meta.len();

Expand Down
30 changes: 15 additions & 15 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -322,9 +322,9 @@ mod tests {
#[test]
fn simple_static() {
let mut router = App::new();
router.at("/").get(|_| async move {"/"});
router.at("/foo").get(|_| async move {"/foo"});
router.at("/foo/bar").get(|_| async move {"/foo/bar"});
router.at("/").get(|_| async move { "/" });
router.at("/foo").get(|_| async move { "/foo" });
router.at("/foo/bar").get(|_| async move { "/foo/bar" });

for path in &["/", "/foo", "/foo/bar"] {
let res = block_on(simulate_request(&router, path, http::Method::GET));
Expand All @@ -336,23 +336,23 @@ mod tests {
#[test]
fn nested_static() {
let mut router = App::new();
router.at("/a").get(|_| async move {"/a"});
router.at("/a").get(|_| async move { "/a" });
router.at("/b").nest(|router| {
router.at("/").get(|_| async move {"/b"});
router.at("/a").get(|_| async move {"/b/a"});
router.at("/b").get(|_| async move {"/b/b"});
router.at("/").get(|_| async move { "/b" });
router.at("/a").get(|_| async move { "/b/a" });
router.at("/b").get(|_| async move { "/b/b" });
router.at("/c").nest(|router| {
router.at("/a").get(|_| async move {"/b/c/a"});
router.at("/b").get(|_| async move {"/b/c/b"});
router.at("/a").get(|_| async move { "/b/c/a" });
router.at("/b").get(|_| async move { "/b/c/b" });
});
router.at("/d").get(|_| async move {"/b/d"});
router.at("/d").get(|_| async move { "/b/d" });
});
router.at("/a/a").nest(|router| {
router.at("/a").get(|_| async move {"/a/a/a"});
router.at("/b").get(|_| async move {"/a/a/b"});
router.at("/a").get(|_| async move { "/a/a/a" });
router.at("/b").get(|_| async move { "/a/a/b" });
});
router.at("/a/b").nest(|router| {
router.at("/").get(|_| async move {"/a/b"});
router.at("/").get(|_| async move { "/a/b" });
});

for failing_path in &["/", "/a/a", "/a/b/a"] {
Expand All @@ -378,9 +378,9 @@ mod tests {
fn multiple_methods() {
let mut router = App::new();
router.at("/a").nest(|router| {
router.at("/b").get(|_| async move {"/a/b GET"});
router.at("/b").get(|_| async move { "/a/b GET" });
});
router.at("/a/b").post(|_| async move {"/a/b POST"});
router.at("/a/b").post(|_| async move { "/a/b POST" });

for (path, method) in &[("/a/b", http::Method::GET), ("/a/b", http::Method::POST)] {
let res = block_on(simulate_request(&router, path, method.clone()));
Expand Down
1 change: 0 additions & 1 deletion src/middleware/cookies.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,5 +172,4 @@ mod tests {

assert!(iter.next().is_none());
}

}