diff --git a/lib/Lutim.pm b/lib/Lutim.pm index 7c46b4f..f7939e7 100644 --- a/lib/Lutim.pm +++ b/lib/Lutim.pm @@ -148,7 +148,7 @@ sub startup { my $short; do { $short= $c->shortener($c->config->{length}); - } while (LutimModel::Lutim->count('WHERE short = ?', $short) || $short eq 'about' || $short eq 'stats' || $short eq 'd' || $short eq 'm' || $short eq 'gallery' || $short eq 'zip'); + } while (LutimModel::Lutim->count('WHERE short = ?', $short) || $short eq 'about' || $short eq 'stats' || $short eq 'd' || $short eq 'm' || $short eq 'gallery' || $short eq 'zip' || $short eq 'infos'); LutimModel::Lutim->create( short => $short, @@ -357,6 +357,10 @@ sub startup { to('Controller#about')-> name('about'); + $r->get('/infos')-> + to('Controller#infos')-> + name('infos'); + $r->get('/stats')-> to('Controller#stats')-> name('stats'); diff --git a/lib/Lutim/Controller.pm b/lib/Lutim/Controller.pm index 92088da..d9229b8 100644 --- a/lib/Lutim/Controller.pm +++ b/lib/Lutim/Controller.pm @@ -51,6 +51,22 @@ sub stats { ); } +sub infos { + my $c = shift; + + $c->render( + json => { + broadcast_message => $c->config('broadcast_message'), + image_magick => ($im_loaded) ? true : false, + contact => $c->config('contact'), + max_file_size => $c->config('max_file_size'), + default_delay => $c->config('default_delay'), + max_delay => $c->config('max_delay'), + always_encrypt => ($c->config('always_encrypt')) ? true : false, + } + ); +} + sub webapp { my $c = shift;