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

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -