Articulate

 view release on metacpan or  search on metacpan

lib/Articulate/Error.pm  view on Meta::CPAN


has http_code => (
  is      => 'rw',
  default => sub { 500 },
  coerce  => sub { 0 + shift }
);

has caller => (
  is      => 'rw',
  default => sub {
    ( [ caller(0) ]->[0] =~ m/Throwable/ )
      ? [ 'hmm', caller(2) ]
      : [ caller(1) ];
  }
);

# This needs to go at the end, because of Class::XSAccessor stuff

Module::Load::load( __PACKAGE__ . '::' . $_ ) for qw(
  BadRequest
  Forbidden
  Internal
  NotFound

lib/Articulate/Syntax/Routes.pm  view on Meta::CPAN


#  request upload uploads captures param params splat
#  config var session template
#  redirect forward halt pass send_error status
# ); # the first line will stay, everything else will find its way into framework

no warnings 'redefine';

sub on_enable {
  my $code   = shift;
  my ($pkg)  = caller(2);
  my $routes = "${pkg}::__routes";
  {
    no strict 'refs';
    $$routes //= [];
    push @$$routes, $code;
  }
}

sub _declare_route {
  my ( $http_verb, $path, $code ) = @_;



( run in 0.930 second using v1.01-cache-2.11-cpan-b61123c0432 )