|
|
@ -30,12 +30,19 @@ sub startup { |
|
|
|
$user->post('/create') ->to(action => 'create'); |
|
|
|
$user->post('/create') ->to(action => 'create'); |
|
|
|
$user->post('/update') ->to(action => 'update'); |
|
|
|
$user->post('/update') ->to(action => 'update'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$self->app->attr(ldap => sub { |
|
|
|
|
|
|
|
require LDV::LDAP; |
|
|
|
|
|
|
|
my $ldap = LDV::LDAP->new($self->app->config->{ldap}); |
|
|
|
|
|
|
|
return $ldap; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
# /zerobin |
|
|
|
# /zerobin |
|
|
|
my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin'); |
|
|
|
my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin'); |
|
|
|
$zb->post('/') -> to(action => 'save'); |
|
|
|
$zb->post('/') -> to(action => 'save'); |
|
|
|
$zb->get ('/') -> to(action => 'create'); |
|
|
|
$zb->get ('/') -> to(action => 'create'); |
|
|
|
$zb->route('/:time', time => qr/\d+/) |
|
|
|
$zb->route('/:time', time => qr/\d+/) |
|
|
|
->via('GET') -> to(action => 'view'); |
|
|
|
->via('GET') -> to(action => 'view'); |
|
|
|
|
|
|
|
|
|
|
|
my $root = $self->app->config->{zerobin}->{root}; |
|
|
|
my $root = $self->app->config->{zerobin}->{root}; |
|
|
|
mkdir $self->app->home->rel_dir($root); |
|
|
|
mkdir $self->app->home->rel_dir($root); |
|
|
|
} |
|
|
|
} |
|
|
|