diff --git a/lib/LDV.pm b/lib/LDV.pm index 07186c3..240993c 100644 --- a/lib/LDV.pm +++ b/lib/LDV.pm @@ -10,7 +10,8 @@ sub startup { my ($self) = @_; $self->plugin(I18N => {default => 'ru'}); - $self->plugin(Config => {file => $self->app->home->rel_file('conf/ldv.conf')}); + my $config = $self->app->home->rel_file('conf/ldv.conf'); + $self->plugin(Config => {file => $config}); $self->app->mode('production'); $self->app->secret($self->app->config->{secret}); @@ -27,9 +28,11 @@ sub startup { # /zerobin my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin'); $zb->post('/') -> to(action => 'save'); - $zb->get('/') -> to(action => 'create'); - $zb->route('/:id', id => qr/[0-9a-f]+/) + $zb->get ('/') -> to(action => 'create'); + $zb->route('/:time', time => qr/\d+/) ->via('GET') -> to(action => 'view'); + my $root = $self->app->config->{zerobin}->{root}; + mkdir $self->app->home->rel_dir($root); } 1;