cpan Mojolicious :: Lite
! / usr / bin / perl use strict; use warnings; use Mojolicious :: Lite; get '/' => sub { my $ self = shift; $ self-> render (text => 'It works!'); }; shagadelic;run:
perl ./mojolitetest.pl daemonthat's all, open it in the browser http: // localhost: 3000 / and enjoy it)
! / usr / bin / perl use strict; use warnings; use Mojolicious :: Lite; get '/' => sub { my $ self = shift; $ self-> render (text => 'It works!'); }; get '/ foo' => sub { my $ self = shift; $ self-> render (template => 'foo'); }; shagadelic; __DATA__ @@ foo.html.eplite It's from template!run the script and at http: // localhost: 3000 / foo we see:
Source: https://habr.com/ru/post/65662/
All Articles