lightrouter
lightrouter copied to clipboard
Unmatch path state?
Dear Gary,
How to add routes with unmatch path state? So I can redirect to 404 page?
Tq. Roy
Routes are matched in order, so first matching one is executed first and then stops. Therefore you can add a route at the very end which always matches, like...
router.add('.*', my404Handler);
.run()
also returns a route that was matched, so you could use that to determine how to proceed in your app.