CPAN::Testers::API - REST API for CPAN Testers data
version 0.015
$ cpantesters-api daemon Listening on http://*:5000
This is a REST API on to the data contained in the CPAN Testers database. This data includes test reports, CPAN distributions, and various aggregate test reporting.
my $schema = $c->schema;
Get the schema, a CPAN::Testers::Schema object. By default, the schema is connected from the local user's config. See "connect_from_config" in CPAN::Testers::Schema for details.
# Called automatically by Mojolicious
This method starts up the application, loads any plugins, sets up routes, and registers helpers.
return $c->render_error( 400 => 'Bad Request' ); return $c->render_error( 400, { path => '/since', message => 'Invalid date/time', } );
Render an error in JSON like other OpenAPI errors. The first argument is the HTTP status code. The remaining arguments are a list of errors to report. Plain strings are turned into one-element hashrefs with a message key. Hashrefs are used as-is.
message
The resulting JSON looks like so:
{ "errors": [ { "path": "/", "message": "Bad Request" } ] } { "errors": [ { "path": "/since", "message": "Invalid date/time" } ] }
This application can be configured by setting the MOJO_CONFIG environment variable to the path to a configuration file. The configuration file is a Perl script containing a single hash reference, like:
MOJO_CONFIG
# api.conf { broker => 'ws://127.0.0.1:5000', }
The possible configuration keys are below:
The URL to a Mercury message broker, starting with ws://. This broker is used to forward messages to every connected user.
ws://
Mojolicious, Mojolicious::Plugin::OpenAPI, CPAN::Testers::Schema, http://github.com/cpan-testers/cpantesters-project, http://www.cpantesters.org
Doug Bell <preaction@cpan.org>
Breno G. de Oliveira <garu@cpan.org>
This software is copyright (c) 2016 by Doug Bell.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install CPAN::Testers::API, copy and paste the appropriate command in to your terminal.
cpanm
cpanm CPAN::Testers::API
CPAN shell
perl -MCPAN -e shell install CPAN::Testers::API
For more information on module installation, please visit the detailed CPAN module installation guide.