Peace/lib/Peace.pm

25 lines
455 B
Perl

package Peace;
use v5.30.0;
use strict;
use warnings;
use Mojo::Base 'Mojolicious';
sub startup {
my $self = shift;
my $home = $ENV{HOME};
# Load configuration from config file
my $config =
$self->plugin( JSONConfig => { file => "$home/.config/peace/peace.conf" } );
# Configure the application
$self->secrets( $config->{secrets} );
# Router
my $r = $self->routes;
$r->post('/users')->to('user#post');
}
1;