[][src]Function tide::redirect::permanent

pub fn permanent(location: impl AsRef<str>) -> PermanentRedirect

Redirect a route permanently to another route.

The route will be permanently with a 301, permanent redirect on a route with the same HTTP method.

Examples

use tide::redirect;

let mut app = tide::new();
app.at("/").get(|_| async move { Ok("meow") });
app.at("/nori").get(redirect::permanent("/"));
app.listen("127.0.0.1:8080").await?;