Add Slapbird stuff back in

This commit is contained in:
swagg boi 2025-04-12 12:36:26 -04:00
parent 808dd7cd14
commit bec86785d8
4 changed files with 8 additions and 1 deletions

View File

@ -61,7 +61,6 @@ tests locally:
## TODOs
- Add SlapbirdAPM back in
- Do I need `SUM` for `by_id()`?
## AGPL-3.0+ANTIFA compliance

View File

@ -7,3 +7,4 @@ requires 'XML::RSS';
requires 'Text::Markdown';
requires 'HTML::Restrict';
requires 'Roman::Unicode';
requires 'SlapbirdAPM::Agent::Mojo';

View File

@ -6,6 +6,7 @@
body_max_length => 8_000,
version => 'Feb 11 2025',
secrets => ['t0p_s3cr3t'],
slapbird_api_key => 'AyyLmao39b4eb99de26d437633e49555',
development => {
pg_string =>
'postgresql://post_text:t0p_s3cr3t@127.0.0.1/post_text'

View File

@ -19,6 +19,12 @@ sub startup($self) {
$self->plugin('Config');
$self->plugin('TagHelpers::Pagination');
# Alpha testing Slapbird APM
if (my $slapbirdapm_api_key = $self->config->{'slapbirdapm_api_key'}) {
$self->plugin('SlapbirdAPM', key => $slapbirdapm_api_key)
if $self->mode eq 'production'
}
# Helpers
$self->helper(pg => sub ($c) {
state $pg = Mojo::Pg->new($c->config->{$self->mode}{'pg_string'})