forked from mojolicious/mojo
/
README
92 lines (71 loc) · 3.32 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
Back in the early days of the web there was this wonderful Perl library called
CGI, many people only learned Perl because of it.
It was simple enough to get started without knowing much about the language
and powerful enough to keep you going, learning by doing was much fun.
While most of the techniques used are outdated now, the idea behind it is
not.
Mojolicious is a new attempt at implementing this idea using state of the art
technology.
Features:
* An amazing MVC web framework supporting a simplified single file mode
through Mojolicious::Lite.
* Very clean and Object Oriented pure Perl API without any hidden magic
and no requirements besides Perl 5.8.1.
* Full stack HTTP 1.1 and WebSocket client/server implementation with
IPv6 and TLS support.
* Builtin async IO and prefork web server with epoll, kqueue, hot
deployment and UNIX domain socket sharing support, perfect for
embedding.
* CGI, FastCGI and PSGI support.
* Fresh code, based upon years of experience developing Catalyst.
And much more for you to discover!
Simplicity:
Web development for humans, making hard things possible and everything
fun.
use Mojolicious::Lite;
get '/time' => 'clock';
websocket '/echo' => sub {
my $self = shift;
$self->receive_message(
sub {
my ($self, $message) = @_;
$self->send_message("echo: $message");
}
);
};
get '/:name' => sub {
my $self = shift;
my $name = $self->param('name') || 'Mojo';
$self->render_text("Hello $name!");
};
shagadelic;
__DATA__
@@ clock.html.ep
% my ($second, $minute, $hour) = (localtime(time))[0, 1, 2];
The time is <%= $hour %>:<%= $minute %>:<%= $second %>.
For more user friendly documentation see "perldoc Mojolicious::Book" and
"perldoc Mojolicious::Lite".
Architecture:
.---------------------------------------------------------------.
| Fun! |
'---------------------------------------------------------------'
.---------------------------------------------------------------.
| |
| .----------------------------------------------'
| | .--------------------------------------------.
| Application | | Mojolicious::Lite |
| | '--------------------------------------------'
| | .--------------------------------------------.
| | | Mojolicious |
'----------------' '--------------------------------------------'
.---------------------------------------------------------------.
| Mojo |
'---------------------------------------------------------------'
.-------. .-----------. .--------. .------------. .-------------.
| CGI | | FastCGI | | PSGI | | HTTP 1.1 | | WebSocket |
'-------' '-----------' '--------' '------------' '-------------'
To install this module type the following:
perl Makefile.PL
make
make test
make install