2013-06-17 12:34:21 -04:00
|
|
|
package Hydra::Base::Controller::REST;
|
|
|
|
|
|
|
|
use strict;
|
|
|
|
use warnings;
|
|
|
|
use base 'Catalyst::Controller::REST';
|
|
|
|
|
2013-07-26 14:25:25 -04:00
|
|
|
# Hack: Erase the map set by C::C::REST
|
|
|
|
__PACKAGE__->config( map => undef );
|
2013-06-17 12:34:21 -04:00
|
|
|
__PACKAGE__->config(
|
|
|
|
map => {
|
2013-07-26 14:25:25 -04:00
|
|
|
'application/json' => 'JSON',
|
|
|
|
'text/x-json' => 'JSON',
|
2013-06-17 12:34:21 -04:00
|
|
|
'text/html' => [ 'View', 'TT' ]
|
|
|
|
},
|
|
|
|
default => 'text/html',
|
|
|
|
'stash_key' => 'resource',
|
|
|
|
);
|
|
|
|
|
|
|
|
sub begin { my ( $self, $c ) = @_; $c->forward('Hydra::Controller::Root::begin'); }
|
|
|
|
sub end { my ( $self, $c ) = @_; $c->forward('Hydra::Controller::Root::end'); }
|
|
|
|
|
|
|
|
1;
|