Download - Mojolicious. Веб в коробке!
![Page 1: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/1.jpg)
Mojolicious.Веб в коробке!
Perl Mova + YAPC::Russia 2010
![Page 2: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/2.jpg)
![Page 3: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/3.jpg)
Что такое Mojolicious?
![Page 4: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/4.jpg)
Что такое Mojolicious?
• Веб-фреймворки: Mojolicious::Lite, Mojolicious, Mojo
• Объектно-ориентированное API, без скрытой магии и зависимостей, написанное на чистом Perl
• Полный стек HTTP 1.1 и WebSocket #76(клиент-сервер), а также IPv6, SSL и IDNA
![Page 5: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/5.jpg)
Что такое Mojolicious?
• Асинхронный ввод-вывод, prefork-веб сервер с поддержкой epoll и kqueue, unix-сокетов и «горячей» разработки
• CGI, FastCGI и PSGI
• RESTful-роутеры, плагины, сессии, Perl-ish шаблонизатор, поддержка I18N, JSON и XML DOM с CSS3-селекторами
![Page 6: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/6.jpg)
«Свежий» код, основанный на опыте разработке Catalyst
![Page 7: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/7.jpg)
«Весёлая ферма» Mojolicious
![Page 8: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/8.jpg)
CGI FastCGI PSGI HTTP 1.1 WebSocket
Mojo
Mojolicious
Mojolicious::Lite
Код
Удовольствие!
Код
![Page 9: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/9.jpg)
Mojolicious::LiteMVC веб-фреймворк
~ sinatra
![Page 10: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/10.jpg)
use Mojolicious::Lite;
get '/hello' => sub { shift->render_text( 'Привет Киев!' );};
app->start;
![Page 11: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/11.jpg)
use Mojolicious::Lite;
post '/hello' => sub { shift->render_text( 'Привет Киев!' );};
app->start;
![Page 12: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/12.jpg)
use Mojolicious::Lite;
any '/hello' => sub { shift->render_text( 'Привет Киев!' );};
app->start;
![Page 13: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/13.jpg)
use Mojolicious::Lite;
get '/hello' => (agent => qr/Firefox/) => sub { shift->render_text( 'Привет Киев!' );};
app->start;
![Page 14: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/14.jpg)
use Mojolicious::Lite;
post '/:name' => sub { # /* my $self = shift; my $name = $self->param('name');
$self->render_text( "Привет $name!" );};
app->start;
![Page 15: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/15.jpg)
use Mojolicious::Lite;
post '/:name' => sub { # /* my $self = shift; my $name = $self->stash('name');
$self->render_text( "Привет $name!" );};
app->start;
![Page 16: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/16.jpg)
use Mojolicious::Lite;
post '/:name' => { id => 42 } => sub { # /* my $self = shift; my $name = $self->param('name'); warn $self->param( 'id' ); $self->render_text( "Привет $name!" );};
app->start;
![Page 17: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/17.jpg)
use Mojolicious::Lite;
any '/time' => 'clock';
app->start;
__DATA__
@@ clock.html.ep% my ($sec, $min, $hour) = (localtime)[0, 1, 2];Текущее время <%= $hour %>:<%= $min %>:<%= $sec %>
![Page 18: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/18.jpg)
use Mojolicious::Lite;
websocket '/echo' => sub { my $self = shift; $self->receive_message( sub { my ($self, $msg) = @_; $self->send_message( "тук-тук: $msg" ); } );};
![Page 19: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/19.jpg)
Примеры Mojolicious WebSocket
@xantus, @vtiИнтересный пример IRC-клиент
![Page 20: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/20.jpg)
use Mojolicious::Lite;
get '/fetch' => sub { my $self = shift; $self->render_data( $self->client ->get( 'http://2010.yapcrussia.org' ) ->res ->body );};
![Page 21: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/21.jpg)
use Mojolicious::Lite;
plugin charset => { charset => 'UTF-8' };
#
under sub { my $self = shift;
# проверка авторизации };get '/foo' => sub { ... };
![Page 22: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/22.jpg)
Cписок всех роутеров приложения
script/lite.pl routes/hello (?-xism:^/hello)/time (?-xism:^/time)/echo (?-xism:^/echo)/fetch (?-xism:^/fetch)/:name (?-xism:^/((?-xism:\d+)))
![Page 23: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/23.jpg)
Если много шаблонов в секции __DATA__script/lite.pl inflate
/templates//templates/clock.html.ep
![Page 24: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/24.jpg)
Сокращатель ссылокна Mojolicious::Lite
100 строк кода (5 обработчиков)130 строк шаблонов (4 шаблона)
1 файл
![Page 25: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/25.jpg)
![Page 26: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/26.jpg)
MojoliciousMVC веб-фреймворк
~ Ruby on Rails
![Page 27: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/27.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1);}
1;
![Page 28: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/28.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1);}
1;
![Page 29: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/29.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1);}
1;
![Page 30: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/30.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1);}
1;
![Page 31: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/31.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; my $b = $r->bridge->to('auth#check); $b->route('/admin')->to('admin#welcome');}
![Page 32: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/32.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; $self->plugin(charset => { ... }); $self->types->type(json => 'text/plain'); $self->renderer->root( ... );}
1;
![Page 33: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/33.jpg)
package App;use base 'Mojolicious';
sub startup { my $self = shift; my $r = $self->routes; $r->route('/:controller/:action/:id') ->to('example#welcome', id => 1);}
1;
![Page 34: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/34.jpg)
package App::Example;use base 'Mojolicious::Controller';
sub welcome { my $self = shift; warn $self->param( ‘id’ ); $self->render( message => 'Привет Киев!' );}
1;
![Page 35: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/35.jpg)
package App::Example;use base 'Mojolicious::Controller';
sub welcome { my $self = shift; warn $self->stash( ‘id’ ); $self->render( message => 'Привет Киев!' );}
1;
![Page 36: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/36.jpg)
Шаблонexample/welcome.html.ep
controller / action . format . handler
![Page 37: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/37.jpg)
Шаблонexample/welcome.xml.ep
controller / action . format . handler
![Page 38: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/38.jpg)
Шаблонexample/welcome.rss.ep
controller / action . format . handler
![Page 39: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/39.jpg)
Шаблонexample/welcome.mail.ep
controller / action . format . handler
![Page 40: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/40.jpg)
Шаблонexample/welcome.html.ep
controller / action . format . handler
![Page 41: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/41.jpg)
Шаблонexample/welcome.html.ep
controller / action . format . handler
![Page 42: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/42.jpg)
Шаблонexample/welcome.html.tt
controller / action . format . handler
![Page 43: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/43.jpg)
Шаблонexample/welcome.html.cttp2
controller / action . format . handler
![Page 44: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/44.jpg)
Шаблонexample/welcome.html.ep
controller / action . format . handler
![Page 45: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/45.jpg)
% layout 'default';
<h2><%= $message %></h2>
<a href="<%== url_for %>">click here</a>
![Page 46: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/46.jpg)
% layout 'default';
<h2><%= $message %></h2>
<a href="<%== url_for %>">click here</a>
![Page 47: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/47.jpg)
% layout 'default';
<h2><%= stash 'message' %></h2>
<a href="<%== url_for %>">click here</a>
![Page 48: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/48.jpg)
% layout 'default';
<h2><%= $self->stash('message') %></h2>
<a href="<%== url_for %>">click here</a>
![Page 49: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/49.jpg)
% layout 'default';
<h2><%= $message2 %></h2>
<a href="<%== url_for %>">click here</a>
![Page 50: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/50.jpg)
Global symbol "$message2" requires explicit package name at (eval 280) line 2.
1: % layout 'default';2: <h2><%= $message2 %></h2>3: ...
{ 'status' => 500, 'message' => ‘Привет Киев!’, ...
![Page 51: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/51.jpg)
% layout 'default';
<h2><%= $message if is_iphone %></h2>
<a href="<%== url_for %>">click here</a>
![Page 52: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/52.jpg)
sub startup { ... $self->renderer->add_helper( is_iphone => sub { shift->tx->req->headers ->user_agent =~ /iphone|cfnetwork/i ? 1 : 0 });
![Page 53: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/53.jpg)
Шаблонlayouts/default.html.epпуть к layout-шаблонам / имя . format . handler
![Page 54: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/54.jpg)
<!doctype html><html> <head><title> Привет! </title></head> <body> <%== content %> </body></html>
![Page 55: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/55.jpg)
Около 20 проектовна Mojolicious
![Page 56: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/56.jpg)
![Page 57: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/57.jpg)
MojoБазовый веб-фреймворк
![Page 58: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/58.jpg)
package App;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type( 'text/plain' ); $tx->res->body( 'Привет Киев!' );}
![Page 59: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/59.jpg)
package App;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type( 'text/plain' ); $tx->res->body( 'Привет Киев!' );}
![Page 60: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/60.jpg)
GET / HTTP/1.1Connection: keep-aliveAccept: text/html, application/xhtml, ....Accept-Charset: windows-1251, utf-8; ...Accept-Encoding: gzip,deflateAccept-Language: ru,en-us;q=0.7,en;q=0.3Host: localhost:3000User-Agent: Mozilla/5.0 (Macintosh; ...Content-Length: 0Keep-Alive: 300
![Page 61: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/61.jpg)
package App;use base 'Mojo';
sub handler { my ($self, $tx) = @_; warn $tx->req; warn $tx->req->url; $tx->res->headers ->content_type( 'text/plain' ); $tx->res->body( 'Привет Киев!' );}
![Page 62: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/62.jpg)
![Page 63: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/63.jpg)
Mojo::ClientHTTP 1.1 и WebSocket клиент
![Page 64: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/64.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://2010.yapcrussia.org’ => sub { my ($self, $tx) = @_; say $tx->res; })->process;
![Page 65: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/65.jpg)
my $client = Mojo::Client->new;
$client->get( ‘http://2010.yapcrussia.org’ => sub { ... },);$client->post( ‘http://2010.yapcrussia.ru’ => sub { ... },);
$client->process;
![Page 66: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/66.jpg)
my $client = Mojo::Client->new;
$client->get(‘http://goo.gl’)->res->code;
$client->get( 'http://search.twitter.com/trends.json')->success->json->{trends}->[0]->{name}
$client->get( ... )->dom->success ->search('body > #container > div p[id]')
![Page 67: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/67.jpg)
Mojo::IOLoopTCP клиент-сервер
![Page 68: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/68.jpg)
my $loop = Mojo::IOLoop->new;
$loop->listen(port => 3000, cb => sub { my ($self, $id) = @_; $self->read_cb ($id => sub { ... });
$self->write_cb($id => sub { ... }););
my $id = $loop->connect(port => 3000, ...);
$loop->start; $loop->stop;
![Page 69: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/69.jpg)
Test::MojoФреймворк для тестирования
![Page 70: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/70.jpg)
my $t = Test::Mojo->new( app => 'App' );
$t->get_ok( '/hello' ) ->status_is( 200 ) ->header_is( 'X-Powered-By' => 'Mojolicious (Perl)' ) ->content_is( 'Привет Киев!' );
$t->post_ok( '/42' ) ->content_like(qr/Привет/, 'тест пройден!');
![Page 71: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/71.jpg)
Всё, что нужно – есть!Mojolicious – веб в коробке!
![Page 72: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/72.jpg)
Если нет, то есть на CPAN
или github.com :)
![Page 73: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/73.jpg)
Mojolicious на CPAN• Mojolicious
• Mojo::Server::FCGI
• AnyEvent::Mojo
• Apache::Mojo
Apache2::Mojo
• Catalyst::Engine::MojoSquatting::On::Mojo
• MojoX::Log::*
• MojoX::Renderer::*
• TT
• CTTP2, HTP
• XSLT
![Page 74: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/74.jpg)
Модель, где же модель данных?А говорите всё есть :)
![Page 75: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/75.jpg)
Любая модель данных может быть использована
в MojoliciousDBI, DBIx::Class, Fey::ORM, CouchDB, MongoDB, ...
![Page 76: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/76.jpg)
Документация
• Пока мало документации, зато очень хороший фидбек :)
• Mojolicious::Lite и Mojolicious::Guides
• Mojolicious Handbook @kvorg
• Mojolicious FAQ @vti
![Page 77: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/77.jpg)
Полезная информация• http://mojolicious.org
• irc://irc.perl.org/#mojo
• http://groups.google.com/group/mojolicious
• Github: kraih, vti, xantus, memowe, sharifulin
• Twitter: @kraih, @vtivti, @sharifulin
• Juick: @vti, @sharifulin
![Page 78: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/78.jpg)
«Making hard things possible and everything fun!»
Девиз Mojolicious
![Page 79: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/79.jpg)
«Duct tape for the HTML5 Web»
Девиз Mojolicious #2
![Page 80: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/80.jpg)
«Viva la revolution!»
Девиз Mojolicious #3
![Page 81: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/81.jpg)
Mojolicious::Lite vs.
DancerСоревнование
![Page 82: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/82.jpg)
Mojoliciousvs.
CatalystЧто выбрать?
![Page 83: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/83.jpg)
«Особая разновидность современного программиста – программист, изучающий
фреймворки»Алекс Капранов
![Page 84: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/84.jpg)
Анатолий Шарифулин
«Каждый программист должен сделать 3 вещи: фреймворк, шаблонизатор и событийную машину»
![Page 85: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/85.jpg)
use Mojoliciousor die
![Page 86: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/86.jpg)
Viva la revolution!
![Page 87: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/87.jpg)
use Perlor die
![Page 88: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/88.jpg)
JFDI
![Page 89: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/89.jpg)
Посмотрите, какие у меня крутые часы :)
![Page 90: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/90.jpg)
![Page 91: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/91.jpg)
Спасибо за внимание!Анатолий Шарифулин
sharifulin
![Page 92: Mojolicious. Веб в коробке!](https://reader033.vdocuments.pub/reader033/viewer/2022050808/55763f7ed8b42ac31b8b47f6/html5/thumbnails/92.jpg)
any ‘/questions’ => sub { shift->render( answer => ‘sharifulin’ ); };