Browse Source

* update routing

master
Alex 'AdUser' Z 7 years ago
parent
commit
3917778f3e
  1. 26
      lib/LDV.pm

26
lib/LDV.pm

@ -67,23 +67,19 @@ sub startup {
$zb->get('/prune') -> to(action => 'prune');
}
{ # /imgbin
my $conf = $self->app->config->{imgbin};
my $ib = $r->route('/imgbin') -> to(controller => 'imgbin');
$ib->post('/') -> to(action => 'save');
$ib->get ('/') -> to(action => 'create');
$ib->route('/:time', time => qr/\d+/)
{ # /filebin
my $conf = $self->app->config->{filebin};
my $fb = $r->route('/filebin') -> to(controller => 'filebin');
$fb->post('/') -> to(action => 'save');
$fb->get ('/') -> to(action => 'create');
$fb->route('/:time', time => qr/\d+/)
->via('GET') -> to(action => 'view');
$ib->get ('/prune') -> to(action => 'prune');
$ib->get ('/latest') -> to(action => 'latest')
if ($conf->{show_latest});
$fb->get ('/prune') -> to(action => 'prune');
$fb->get ('/latest') -> to(action => 'latest')
if $conf->{show_latest};
mkdir $self->app->home->rel_dir($conf->{root});
mkdir $self->app->home->rel_file('public/images');
mkdir $self->app->home->rel_file('public/images/full');
mkdir $self->app->home->rel_file('public/images/small');
$ENV{MOJO_MAX_MESSAGE_SIZE} = $conf->{maxsize} + 2 * 1024 * 1024; # +2Mb
mkdir $self->app->home->rel_dir('public/files');
$ENV{MOJO_MAX_MESSAGE_SIZE} = $conf->{file_maxsize} + 2 * 1024 * 1024; # +2Mb
}
}

Loading…
Cancel
Save