feat: render the dummy test in json

This commit is contained in:
2025-12-18 09:31:57 +01:00
parent 984438729e
commit 45f8072679

View File

@@ -29,14 +29,17 @@ sub startup {
sub { sub {
my $value = shift; my $value = shift;
$c->app->log->info("Value retrieved: $value"); $c->app->log->info("Value retrieved: $value");
$c->render( text => "ok\nRetrieved value: $value" ); $c->render( json => { status => 'ok', value => $value } );
undef $tx; undef $tx;
} }
)->catch( )->catch(
sub { sub {
my $err = shift; my $err = shift;
$c->app->log->error("DB error: $err"); $c->app->log->error("DB error: $err");
$c->render( text => "ok\nError: $err", status => 500 ); $c->render(
json => { status => 'error', message => "$err" },
status => 500
);
undef $tx; undef $tx;
} }
); );
@@ -45,4 +48,3 @@ sub startup {
} }
1; 1;