If I split my application with Controller classes I can do
get '/foo/bar' => { controller => 'Foo', action => 'bar' };
can I do the same if my action is inside the same Mojolicious::Lite file?
For now I do
sub foobar {
my $c = shift;
...
}
get '/' => sub { foobar(@_) };
but I'd like to do
get '/' => { action => 'foobar' };
for consistency and ease of splitting later should I decide to do so, while keeping the general Mojolicious::Lite structure (i.e: single file).
How can this be done?