Actions Status Coverage Status MetaCPAN Release

NAME

Amon2::Plugin::Web::CpanelJSON - Cpanel::JSON::XS plugin

SYNOPSIS

use Amon2::Lite;
use Cpanel::JSON::XS::Type;
use HTTP::Status qw(:constants);

__PACKAGE__->load_plugins(qw/Web::CpanelJSON/);

use constant HelloWorld => {
    message => JSON_TYPE_STRING,
};

get '/' => sub {
    my $c = shift;
    return $c->render_json(+{ message => 'HELLO!' }, HelloWorld, HTTP_OK);
};

__PACKAGE__->to_app();

DESCRIPTION

This is a JSON plugin for Amon2. The differences from Amon2::Plugin::Web::JSON are as follows.

* Cpanel::JSON::XS::Type is available

* HTTP status code can be specified

* Flexible Configurations

METHODS

CONFIGURATION

LICENSE

Copyright (C) kfly8.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

kfly8 kfly@cpan.org