Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.56 KB | None | 0 0
  1. # This is what I have
  2. my $collection = $r->under('/rest/:table')->to('rest#collection');
  3. $collection->get('/')->to('rest#collection_get');
  4. $collection->options('/')->to('rest#collection_options');
  5. $collection->post('/')->to('rest#collection_put');
  6.  
  7. my $item = $collection->under('/:row_id')->to('rest#item');
  8. $item->get('/')->to('rest#item_read');
  9. $item->delete('/')->to('rest#item_delete');
  10.  
  11. # What I want is to now be able to do something like:
  12. $collection->after(sub {
  13.     my $c = shift;
  14.     return $c->render( json => $c->stash->{'something_added_above'} )
  15. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement