Mojo::Server::Morbo - DOOOOOOOOOOOOOOOOOOM!
use Mojo::Server::Morbo; my $morbo = Mojo::Server::Morbo->new; $morbo->run('./myapp.pl');
Mojo::Server::Morbo is a full featured self-restart capable non-blocking I/O HTTP 1.1 and WebSocket server built around the very well tested and reliable Mojo::Server::Daemon with IPv6, TLS, Bonjour and libev support.
IPv6
TLS
Bonjour
libev
To start applications with it you can use the morbo script.
$ morbo myapp.pl Server available at http://127.0.0.1:3000.
Optional modules EV, IO::Socket::IP, IO::Socket::SSL and Net::Rendezvous::Publish are supported transparently and used if installed. Individual features can also be disabled with the MOJO_NO_BONJOUR, MOJO_NO_IPV6 and MOJO_NO_TLS environment variables.
MOJO_NO_BONJOUR
MOJO_NO_IPV6
MOJO_NO_TLS
Mojo::Server::Morbo implements the following attributes.
watch
my $watch = $morbo->watch; $morbo = $morbo->watch(['/home/sri/myapp']);
Files and directories to watch for changes, defaults to the application script as well as the lib and templates directories in the current working directory.
lib
templates
Mojo::Server::Morbo inherits all methods from Mojo::Base and implements the following new ones.
check_file
my $success = $morbo->check_file('/home/sri/lib/MyApp.pm');
Check if file has been modified since last check.
run
$morbo->run('script/myapp');
Run server for application.
You can set the MORBO_DEBUG environment variable to get some advanced diagnostics information printed to STDERR.
MORBO_DEBUG
STDERR
MORBO_DEBUG=1
Mojolicious, Mojolicious::Guides, http://mojolicio.us.
To install Mojolicious, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Mojolicious
CPAN shell
perl -MCPAN -e shell install Mojolicious
For more information on module installation, please visit the detailed CPAN module installation guide.