Skip to content
  • v0.6.0
  • d17bc0b
  • Compare
    Choose a tag to compare
    Search for a tag
  • v0.6.0
  • d17bc0b
  • Compare
    Choose a tag to compare
    Search for a tag

@yoshuawuyts yoshuawuyts released this Jan 30, 2020 · 13 commits to master since this release

API Documentation

This patch introduces a new cookies API, based on the excellent
cookie crate. Working with cookies is a staple for
any web server, and Tide's new API now makes this entirely declarative.

Additionally we've added back CORS support. This makes it possible for
possible to configure the single-origin policy of browsers, which is an
incredibly valuable resource.

And finally nesting services with Tide has become even easier. Building on
the APIs in 0.5.0, the manual song-and-dance required to nest APIs is no
longer required, and services can now be nested as-is through the
Route::nest API.



use cookie::Cookie;
use tide::Response;

let mut app = tide::new();"/").get(|req| async move {
    println!("cat snack: {:?}", req.cookie("snack"));
});"/set").get(|req| async move {
    let mut res = Response::new(200);
    res.set_cookie(Cookie::new("snack", "tuna"));


Make GET, POST, and OPTIONS endpoints on this server accessible from any web

use http::header::HeaderValue;
use tide::middleware::{Cors, Origin};

let rules = Cors::new()
    .allow_methods(HeaderValue::from_static("GET, POST, OPTIONS"))

let mut app = tide::new();
app.middleware(rules);"/").post(|_| async { Response::new(200) });


Nest the inner serve inside the outer service, exposing GET /cat/nori.

let mut inner = tide::new();"/nori").get(|_| async { Response::new(200) });

let mut outer = tide::new();"/cat").nest(inner);



  • Added Route::all to match all HTTP methods on a route (#379)
  • Added Route::nest to nest instances of tide::Server on sub-routes (#379)
  • Added a new cors submodule containing CORS control middleware (#373)
  • Added Request::cookie to get a cookie sent by the client (#380)
  • Added Response::set_cookie to instruct the client to set a cookie (#380)
  • Added Response::remove_cookie to instruct the client to unset a cookie (#380)


  • Changed the behavior of optional params in Request.query to be more intuitive (384)
  • Improved the debugging experience of query deserialization errors (384)
  • Updated the GraphQL example to use the latest version of Juniper (#372)
  • Tide no longer prints to stdout when started (387)


  • Fixed an incorrect MIME type definition on Response::body (378)
Assets 2
You can’t perform that action at this time.