Is there any way to customize hypnotoad listen port NOT from external config file ?

308 views
Skip to first unread message

Pavel Serikov

unread,
Feb 16, 2017, 4:52:51 PM2/16/17
to Mojolicious
I'm writing a script which will manage ports of my mojo apps. 

E.g. I want to manage server.pl app:

my $hypnotoad = Mojo::Server::Hypnotoad->new;
$hypnotoad
->configure('server.conf');
$hypnotoad
->run('server.pl');

If I need to specify port other than 8080 - I need to setup it in server.conf like

{
  hypnotoad
=> {
    listen  
=> ['http://*:8093'],
 
}
};

Is there any way to setup it directly, without external config file ?

I found that Mojo::Server::Hypnotoad has listen attribute but it seems doesn't work or I'm using it wrong way:

my $hypnotoad = Mojo::Server::Hypnotoad->new;
$hypnotoad
->listen(['https://127.0.0.1:8093']);
$hypnotoad
->run('server.pl');

I'm getting
Can't locate object method "listen" via package "Mojo::Server::Hypnotoad"
error

Any suggestions appreciated.

sri

unread,
Feb 16, 2017, 4:55:45 PM2/16/17
to Mojolicious
No, you can't do that, it's incompatible with zero downtime software upgrades.

--
sebastian
Reply all
Reply to author
Forward
0 new messages