Browse Source

+ /imgbin routes

master
Alex 'AdUser' Z 9 years ago
parent
commit
06096eff7d
  1. 24
      lib/LDV.pm

24
lib/LDV.pm

@ -42,7 +42,7 @@ sub startup {
$user->post('/create') ->to(action => 'create');
$user->post('/update') ->to(action => 'update');
# /zerobin
{ # /zerobin
my $zb = $r->route('/zerobin2') -> to(controller => 'zerobin');
$zb->post('/') -> to(action => 'save');
$zb->get ('/') -> to(action => 'create');
@ -50,8 +50,26 @@ sub startup {
->via('GET') -> to(action => 'view');
$zb->get('/prune') -> to(action => 'prune');
my $root = $self->app->config->{zerobin}->{root};
mkdir $self->app->home->rel_dir($root);
my $conf = $self->app->config->{zerobin};
mkdir $self->app->home->rel_dir($conf->{root});
}
{ # /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+/)
->via('GET') -> to(action => 'view');
#$ib->get('/prune') -> to(action => 'prune');
my $conf = $self->app->config->{imgbin};
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
}
}
1;

Loading…
Cancel
Save