rust - How to change Iron's default 404 behaviour? -


i want change default 404 behaviour in small iron application. want add simple text content it, nothing complicated using templates.

create , start program on iron::chain, , create iron::middleware::aftermiddleware. middleware like:

fn custom_404(req: &mut request, res: &mut response) -> ironresult<response> {     if response.status == some(status::notfound) {         // create response desired here.     } } 

Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -