File: Dispatch.pm

package info (click to toggle)
libweb-simple-perl 0.033-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 380 kB
  • sloc: perl: 1,622; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 304 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
package Plack::Middleware::Dispatch;

use Moo;

extends 'Web::Dispatch';

has app => (is => 'ro', writer => '_set_app');

sub wrap {
  my ($self, $app, @args) = @_;
  if (ref $self) {
    $self->_set_app($app);
  } else {
    $self = $self->new({ app => $app, @args });
  }
  return $self->to_app;
}

1;