Function warp::redirect::redirect[][src]

pub fn redirect(uri: impl AsLocation) -> impl Reply

A simple 301 permanent redirect to a different location.

Example

use warp::{http::Uri, Filter};

let route = warp::path("v1")
    .map(|| {
        warp::redirect(Uri::from_static("/v2"))
    });