Peace/lib/Peace.pm

62 lines
1.0 KiB
Perl

package Peace;
use v5.30.0;
use strict;
use warnings;
use Mojo::Base 'Mojolicious';
sub startup {
my $self = shift;
my $config = $self->config;
# Configure the application
$self->secrets( $config->{secrets} );
# Router
my $r = $self->routes;
$r->post('/developer')->to('developer#post');
$r->post('/developer/#identifier/application')
->to('application#developer_application_post');
}
sub peace_config {
my $self = shift;
my $home = $ENV{HOME};
return $self->plugin(
JSONConfig => { file => "$home/.config/peace/peace.conf" } );
}
1;
=encoding utf8
=head1 NAME
Peace - Onlie GNU/Linux flatpak apps store.
=head1 SYNOPSIS
./peace
=head1 DESCRIPTION
Peace is the server backend for flatstore a shop
to be able to sell or buy flatpak applications.
=head1 FUNCTIONS
Peace implements the following functions:
=head2 startup
For internal usage from Mojolicious.
=head2 peace_config
my $config = Peace->new->peace_config;
Retrieves the config for the peace application.
=cut