Browse Source

* LDV : fix routes for zerobin

master
Alex "AdUser" Z 10 years ago
parent
commit
5fd974a185
  1. 9
      lib/LDV.pm

9
lib/LDV.pm

@ -10,7 +10,8 @@ sub startup {
my ($self) = @_; my ($self) = @_;
$self->plugin(I18N => {default => 'ru'}); $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->mode('production');
$self->app->secret($self->app->config->{secret}); $self->app->secret($self->app->config->{secret});
@ -27,9 +28,11 @@ sub startup {
# /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('/:id', id => qr/[0-9a-f]+/) $zb->route('/:time', time => qr/\d+/)
->via('GET') -> to(action => 'view'); ->via('GET') -> to(action => 'view');
my $root = $self->app->config->{zerobin}->{root};
mkdir $self->app->home->rel_dir($root);
} }
1; 1;

Loading…
Cancel
Save