|
|
|
@ -16,6 +16,12 @@ sub startup {
|
|
|
|
|
$self->app->mode('production'); |
|
|
|
|
$self->app->secret($self->app->config->{secret}); |
|
|
|
|
|
|
|
|
|
$self->app->attr(ldap => sub { |
|
|
|
|
require LDV::LDAP; |
|
|
|
|
my $ldap = LDV::LDAP->new($self->app->config->{ldap}); |
|
|
|
|
return $ldap; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
my $r = $self->routes; |
|
|
|
|
|
|
|
|
|
# /user |
|
|
|
@ -30,12 +36,6 @@ sub startup {
|
|
|
|
|
$user->post('/create') ->to(action => 'create'); |
|
|
|
|
$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 |
|
|
|
|
my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin'); |
|
|
|
|
$zb->post('/') -> to(action => 'save'); |
|
|
|
|