Mojo::Server::Morbo - DOOOOOOOOOOOOOOOOOOM!
use Mojo::Server::Morbo; my $morbo = Mojo::Server::Morbo->new; $morbo->run('/home/sri/myapp.pl');
Mojo::Server::Morbo is a full featured, self-restart capable non-blocking I/O HTTP and WebSocket server, built around the very well tested and reliable Mojo::Server::Daemon, with IPv6, TLS, Comet (long polling), keep-alive and multiple event loop support. Note that the server uses signals for process management, so you should avoid modifying signal handlers in your applications.
To start applications with it you can use the morbo script.
$ morbo ./myapp.pl Server available at http://127.0.0.1:3000.
For better scalability (epoll, kqueue) and to provide non-blocking name resolution, SOCKS5 as well as TLS support, the optional modules EV (4.0+), Net::DNS::Native (0.15+), IO::Socket::Socks (0.64+) and IO::Socket::SSL (1.84+) will be used automatically if possible. Individual features can also be disabled with the MOJO_NO_NDN, MOJO_NO_SOCKS and MOJO_NO_TLS environment variables.
MOJO_NO_NDN
MOJO_NO_SOCKS
MOJO_NO_TLS
See "DEPLOYMENT" in Mojolicious::Guides::Cookbook for more.
Mojo::Server::Morbo implements the following attributes.
my $watch = $morbo->watch; $morbo = $morbo->watch(['/home/sri/my_app']);
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.
my $file = $morbo->check;
Check if file from "watch" has been modified since last check and return its name or undef if there have been no changes.
undef
$morbo->run('script/my_app');
Run server for application.
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.