I'm trying to understand mojolicious routing a little better.
Can someone explain the difference between using something like
$r->route('/register')->via('get')->to('auth#register')
as opposed to
$r->get('/register')->to('auth#register')
or are they exactly the same?
Well spotted - they are the same.
getis a shorthand forroute->via('get').viais set up to restrict a route to particular methods (e.g.GETorPOSTor both). It might appear redundant, but consider how often you're likely to have aget()route in your Mojolicious app...