Adding listen shortcut.

This commit is contained in:
Sergiotarxz 2024-11-02 21:27:23 +01:00
parent 3385809e09
commit 1cd463434a

View File

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