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