The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Mojo - The Web In A Box!

SYNOPSIS

use base 'Mojo';

# All the complexities of CGI, FastCGI and HTTP get reduced to a
# single method call!
sub handler {
    my ($self, $tx) = @_;

    # Request
    my $method = $tx->req->method;
    my $path   = $tx->req->url->path;

    # Response
    $tx->res->headers->content_type('text/plain');
    $tx->res->body("$method request for $path!");
}

DESCRIPTION

Mojo provides a minimal interface between web servers and Perl web frameworks.

Also included in the distribution are two MVC web frameworks named Mojolicious and Mojolicious::Lite.

Currently there are no requirements besides Perl 5.8.1.

.------------------------------------------------------------.
|                                                            |
|   Application  .-------------------------------------------'
|                | .-------------------. .-------------------.
|                | |    Mojolicious    | | Mojolicious::Lite |
'----------------' '-------------------' '-------------------'
.------------------------------------------------------------.
|                           Mojo                             |
'------------------------------------------------------------'
.------------------. .------------------. .------------------.
|        CGI       | |      FastCGI     | |     HTTP 1.1     |
'------------------' '------------------' '------------------'

For user friendly documentation see Mojolicious::Book and Mojolicious::Lite.

ATTRIBUTES

Mojo implements the following attributes.

build_tx_cb

my $cb = $mojo->build_tx_cb;
$mojo  = $mojo->build_tx_cb(sub { ... });

client

my $client = $mojo->client;
$mojo      = $mojo->client(Mojo::Client->new);

home

my $home = $mojo->home;
$mojo    = $mojo->home(Mojo::Home->new);

log

my $log = $mojo->log;
$mojo   = $mojo->log(Mojo::Log->new);

METHODS

Mojo inherits all methods from Mojo::Base and implements the following new ones.

new

my $mojo = Mojo->new;

handler

$tx = $mojo->handler($tx);

start

Mojo->start;
Mojo->start('daemon');

SUPPORT

Web

http://mojolicious.org

IRC

#mojo on irc.perl.org

Mailing-List

http://lists.kraih.com/listinfo/mojo

DEVELOPMENT

Repository

http://github.com/kraih/mojo/commits/master

SEE ALSO

Mojolicious

AUTHOR

Sebastian Riedel, sri@cpan.org.

CREDITS

In alphabetical order:

Adam Kennedy

Adriano Ferreira

Alexey Likhatskiy

Anatoly Sharifulin

Andre Vieth

Andreas Koenig

Andy Grundman

Aristotle Pagaltzis

Ask Bjoern Hansen

Audrey Tang

Breno G. de Oliveira

Burak Gursoy

Ch Lamprecht

Christian Hansen

David Davis

Gisle Aas

Graham Barr

James Duncan

Jaroslav Muhin

Jesse Vincent

Kazuhiro Shibuya

Kevin Old

Lars Balker Rasmussen

Leon Brocard

Maik Fischer

Marcus Ramberg

Mark Stosberg

Maksym Komar

Pascal Gaudette

Pedro Melo

Pierre-Yves Ritschard

Rafal Pocztarski

Randal Schwartz

Robert Hicks

Shu Cho

Stanis Trendelenburg

Tatsuhiko Miyagawa

Uwe Voelker

Viacheslav Tikhanovskii

Yuki Kimoto

COPYRIGHT AND LICENSE

Copyright (C) 2008-2009, Sebastian Riedel.

This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License version 2.0.