perldoc
Modules
Mojolicious:Lite #micro real-time web framework built around Mojolicious.
Tool
/home/work/opstools/autopush/dev/autopush/lib/mojo/bin/morbo #build in development webserver
简单程序HelloWorld
1. , , and Perl 5.10 features are automatically enabled and a few functions imported when you use Mojolicious::Lite
2. 支持修改后立即生效,无需重启
3. 启动; morbo helloworld.pl -l http://*:PORTNUM 或 perl helloworld.pl -l http://*:PORTNUM
- #!/usr/bin/perl
-
use warnings;
- use strict;
-
use lib qw{
-
/home/work/opstools/autopush/dev/autopush/lib/mojo/share/perl5
-
/home/work/opstools/autopush/dev/autopush/lib/timehire/lib64/perl5/
-
};
-
use Mojolicious::Lite;
-
-
get '/' => sub {
-
my $self = shift; #$self : a Mojolicious::Controller object containing both the HTTP request and response.
-
$self->render(text => 'Hello World!');
- };
- app->start;
- 或
-
get '/' => {text => 'Hello World!'};
- mojo generate lite_app myliteapp #plugin, app, lite_app, makefile多种选择