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