percy icon indicating copy to clipboard operation
percy copied to clipboard

Better 404 handling in isomorphic app

Open mathiversen opened this issue 5 years ago • 2 comments

  • There seems to be a bug when navigating to the catch_all route but not contributors, ex. localhost:7878/test. The current implementation panics using both rocket and actix as server.
  • Rocket currently has 404 for unknown routes and this should be added to the actix example as well.

mathiversen avatar Jul 18 '19 14:07 mathiversen

Ah thanks for pointing this out!

chinedufn avatar Jul 28 '19 11:07 chinedufn

Here's an example of what I did using the isomorphic example.

lib.rs

impl App {
    pub fn render(&self) -> VirtualNode {
        match self.router.view(self.store.borrow().path()) {
            Some(route) => route,
            None => NotFoundView::new().render(),
        }
    }
}

AxelNilsson avatar Jan 18 '21 16:01 AxelNilsson