Skip to content

Commit

Permalink
more lite route examples
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 13, 2012
1 parent 7731d4e commit c39af09
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/Mojolicious/Guides/Routing.pod
Expand Up @@ -531,6 +531,16 @@ and also part of the normal router.
# GET /foo -> {controller => 'foo', action => 'abc'}
$r->get('/foo')->to(controller => 'foo', action => 'abc');

# POST /bar -> {controller => 'foo', action => 'bar'}
$r->post('/bar')->to('foo#bar');

# GET /baz -> {template => 'foo/bar'}
$r->get('/baz')->to(template => 'foo/bar');

# * /yada.txt -> {controller => 'foo', action => 'yada', format => 'txt'}
# * /yada.json -> {controller => 'foo', action => 'yada', format => 'json'}
$r->any('/yada' => [format => ['txt', 'json']])->to('foo#yada');

This makes the process of growing your L<Mojolicious::Lite> prototypes into
full L<Mojolicious> applications very straightforward.

Expand Down

0 comments on commit c39af09

Please sign in to comment.