App-CPANIDX-HTTP-Server
view release on metacpan or search on metacpan
lib/App/CPANIDX/HTTP/Server.pm view on Meta::CPAN
}
}
else {
warn $DBI::errstr, "\n";
return @results;
}
}
return @results;
}
1;
__END__
=pod
=head1 NAME
App::CPANIDX::HTTP::Server - HTTP::Server::Simple based server for CPANIDX
=head1 VERSION
version 0.08
=head1 SYNOPSIS
use strict;
use warnings;
use App::CPANIDX::HTTP::Server;
my $dsn = 'dbi:SQLite:dbname=cpanidx.db';
my $user = '';
my $pass = '';
my $port = 8082; # the port to listen for requests on
my $server = App::CPANIDX::HTTP::Server->new( $port );
$server->dsn( $dsn, $user, $pass );
$server->run();
# Requests can now be directed to http://nameofyourserver:8082/cpanidx/
=head1 DESCRIPTION
App::CPANIDX::HTTP::Server is a L<HTTP::Server::Simple> based server for CPANIDX.
Use the C<cpanidx-gendb> script provided by L<App::CPANIDX> to generate a CPANIDX
database and then use this module to serve the associated data.
=head1 METHODS
=over
=item C<new>
Start a new instance of App::CPANIDX::HTTP::Server. Takes one option, the port number to
start listening on for requests. If it is not provided will default to C<8080>.
=item C<dsn>
After running C<new>, but before calling C<run>, call this to assign the database details to
the server. Takes three arguments: a L<DBI> C<DSN> string, a username (if applicable) and a
password (if applicable).
=item C<run>
Runs the server and starts handling requests.
=item C<handle_request>
Deals with requests. No user serviceable parts.
=back
=head1 SEE ALSO
L<App::CPANIDX>
=head1 AUTHOR
Chris Williams <chris@bingosnet.co.uk>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Chris Williams.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 1.083 second using v1.01-cache-2.11-cpan-39bf76dae61 )