Mojo::Server man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Mojo::Server(3)	      User Contributed Perl Documentation      Mojo::Server(3)

NAME
       Mojo::Server - HTTP Server Base Class

SYNOPSIS
	 use Mojo::Base 'Mojo::Server';

	 sub run {
	   my $self = shift;

	   # Get a transaction
	   my $tx = $self->on_transaction->($self);

	   # Call the handler
	   $tx = $self->on_request->($self);
	 }

DESCRIPTION
       Mojo::Server is an abstract HTTP server base class.

ATTRIBUTES
       Mojo::Server implements the following attributes.

   "app"
	 my $app = $server->app;
	 $server = $server->app(MojoSubclass->new);

       Application this server handles, defaults to a Mojo::HelloWorld object.

   "app_class"
	 my $app_class = $server->app_class;
	 $server       = $server->app_class('MojoSubclass');

       Class of the application this server handles, defaults to
       Mojo::HelloWorld.

   "on_request"
	 my $handler = $server->on_request;
	 $server     = $server->on_request(sub {
	   my ($self, $tx) = @_;
	 });

       Callback to be invoked for requests that need a response.

   "on_transaction"
	 my $btx = $server->on_transaction;
	 $server = $server->on_transaction(sub {
	   my $self = shift;
	   return Mojo::Transaction::HTTP->new;
	 });

       Callback to be invoked when a new transaction is needed.

   "on_websocket"
	 my $handshake = $server->on_websocket;
	 $server       = $server->on_websocket(sub {
	   my ($self, $tx) = @_;
	 });

       Callback to be invoked for WebSocket handshakes.

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

   "load_app"
	 my $app = $server->load_app('./myapp.pl');

       Load application from script.  Note that this method is EXPERIMENTAL
       and might change without warning!

	 print Mojo::Server->new->load_app('./myapp.pl')->home;

   "run"
	 $server->run;

       Start server.

SEE ALSO
       Mojolicious, Mojolicious::Guides, <http://mojolicio.us>.

perl v5.14.1			  2011-09-01		       Mojo::Server(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net