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
Post a Comment