30 lines
748 B
Perl
30 lines
748 B
Perl
package MakeThemPay;
|
|
use Mojo::Base 'Mojolicious', -signatures;
|
|
|
|
# This method will run once at server start
|
|
sub startup ($self) {
|
|
|
|
# Load configuration from config file
|
|
my $config = $self->plugin('NotYAMLConfig');
|
|
$self->config(
|
|
hypnotoad => {
|
|
proxy => 1,
|
|
listen => [ $self->config('listen') // 'http://localhost:3000' ]
|
|
}
|
|
);
|
|
|
|
# Configure the application
|
|
$self->secrets( $config->{secrets} );
|
|
|
|
# Router
|
|
my $r = $self->routes;
|
|
|
|
# Normal route to controller
|
|
$r->get('/get_pay_url/:uuid')->to('Main#get_url');
|
|
$r->get('/price/:uuid')->to('Main#price');
|
|
$r->get('/set_paid/:uuid')->to('Main#set_paid');
|
|
$r->get('/get_paid/:uuid')->to('Main#get_paid');
|
|
}
|
|
|
|
1;
|