mirror of
https://framagit.org/fiat-tux/hat-softwares/lutim.git
synced 2026-08-06 17:03:25 +02:00
Add GET /infos API endpoint
See https://framagit.org/luc/lutim/wikis/API for details This commit is dedicated to Schoumi. Thx for your support on Tipeee :-)
This commit is contained in:
+5
-1
@@ -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');
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user