From c3b45276a3bf2d006b5cdee78cfccfb06590e998 Mon Sep 17 00:00:00 2001 From: swaggboi Date: Tue, 11 Feb 2025 16:11:37 -0500 Subject: [PATCH] Add /version route --- example_post_text.conf | 1 + lib/PostText.pm | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/example_post_text.conf b/example_post_text.conf index 7926ff1..486dfcb 100644 --- a/example_post_text.conf +++ b/example_post_text.conf @@ -4,6 +4,7 @@ remarks_per_page => 5, results_per_page => 5, body_max_length => 8_000, + version => 'Feb 11 2025', secrets => ['t0p_s3cr3t'], development => { pg_string => diff --git a/lib/PostText.pm b/lib/PostText.pm index 4344d3f..d457498 100644 --- a/lib/PostText.pm +++ b/lib/PostText.pm @@ -142,6 +142,13 @@ sub startup($self) { $c->redirect_to('threads_list'); }); + # Hide a version string to check build later + if (my $version = $self->config->{'version'}) { + $r->get('/version', sub ($c) { + $c->render(text => $version) + }); + } + # Static pages $r->get('/about')->to('page#about')->name('about_page');