pub fn routes(s: &State) -> BoxedFilter<(impl warp::Reply,)> {
    api(&s)
        .or(static_files_handler())
        .or(cors()) // Handle Options requests
        .recover(customize_error) // Top level error correction
        .map(|r| {
            // In order for CORS to work properly, every response has to contain the Access-Control-Allow-Origin header
            warp::reply::with_header(r, "Access-Control-Allow-Origin", "*")
        })
        .boxed()
}
/// Combine the API with the static file handler.
/// Any missed GETs that doesn't start with '/api' will redirect to the index.html.
/// Also support CORS, as that should be applied to the whole server.
Combine the API with the static file handler.
Any missed GETs that doesn't start with '/api' will redirect to the index.html.
Also support CORS, as that should be applied to the whole server.
Combine the API with the static file handler . Any missed GETs that doesn ' t start with ' / api ' will redirect to the index . html . Also support CORS as that should be applied to the whole server .
pub fn routes(s: &State) -> BoxedFilter<(impl warp::Reply,)> {
    api(&s)
        .or(static_files_handler())
        .or(cors()) // Handle Options requests
        .recover(customize_error) // Top level error correction
        .map(|r| {
            // In order for CORS to work properly, every response has to contain the Access-Control-Allow-Origin header
            warp::reply::with_header(r, "Access-Control-Allow-Origin", "*")
        })
        .boxed()
}
pub fn routes ( s : & State ) -> BoxedFilter < ( impl warp :: Reply , ) > { api ( & s ) . or ( static_files_handler ( ) ) . or ( cors ( ) ) // Handle Options requests . recover ( customize_error ) // Top level error correction . map ( | r | { // In order for CORS to work properly, every response has to contain the Access-Control-Allow-Origin header warp :: reply :: with_header ( r , " " , " " ) } ) . boxed ( ) }
Combine the API with the static file handler.
Combine the API with the static file handler .
s
&State
s
&State