perl-Atto-0.004-alt1.noarch.rpm


Advertisement

Description

perl-Atto - A tiny microservice builder

Property Value
Distribution ALT Linux Sisyphus
Repository Autoimports noarch
Package name perl-Atto
Package version 0.004
Package release alt1
Package architecture noarch
Package type rpm
Installed size 27.06 KB
Download size 27.06 KB
Official Mirror ftp.altlinux.org
Atto makes it trivial to create HTTP+JSON microservices out of regular Perl
code.
Adding it to your code is simple. When you `use Atto', pass it it a list of
methods (subs) in the same package that you want to make available to the
network:
use Atto qw(hello);
Then, at the end of your program (or module!), call `Atto->psgi'. This returns a
PSGI application that can be consumed by `plackup'.
$ plackup hello.pl
HTTP::Server::PSGI: Accepting connections at http://0:5000/
To call your methods from the network, send a POST request with the method
(sub) name in the URL:
$ curl -XPOST http://localhost:5000/hello
"hello world"
To pass arguments to the method, encode them as JSON in the request body and
add a `Content-type: application/json' header to the request:
$ curl -XPOST -d '{"name":"dave"}' -H 'Content-type: application/json' http://localhost:5000/hello
"hello dave"
Arguments are flattened just like in Perl, so passing a JSON array or object
will do what you expect.
Alternatively, you can pass a hash via form parameters, which is less
expressive but easier in many scenarios:
$ curl -d 'name=dave' http://localhost:5000/hello
"hello dave"
or with a GET and query parameters:
$ curl http://localhost:5000/hello?name=dave
"hello dave"
Methods should return a single value, which is then JSON-encoded for the
return. This can be a simple string or number or a hash or array ref.

Alternatives

Package Version Architecture Repository
perl-Atto - - -

Requires

Name Value
/usr/share/perl5 -
perl(JSON/MaybeXS.pm) -
perl(Plack/Request.pm) -
perl(WWW/Form/UrlEncoded.pm) -
rpmlib(PayloadIsLzma) -

Provides

Name Value
perl(Atto.pm) = 0.004
perl-Atto = 0.004-alt1

Download

Type URL
Binary Package perl-Atto-0.004-alt1.noarch.rpm
Source Package perl-Atto-0.004-alt1.src.rpm

Install Howto

  1. Add the following line to /etc/apt/sources.list:
    
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    rpm [Sisyphus] http://ftp.altlinux.org/pub/distributions/ALTLinux/autoimports/Sisyphus noarch autoimports
    
  2. Update the package index:
    # sudo apt-get update
  3. Install perl-Atto rpm package:
    # sudo apt-get install perl-Atto

Files

Path
/usr/share/doc/perl-Atto-0.004/Changes
/usr/share/doc/perl-Atto-0.004/LICENSE
/usr/share/doc/perl-Atto-0.004/README
/usr/share/doc/perl-Atto-0.004/examples/hello.pl
/usr/share/perl5/Atto.pm

See Also

Package Description
perl-Attribute-Args-0.06-alt1.noarch.rpm check subroutine param types
perl-Attribute-Benchmark-0.001-alt1.noarch.rpm dead easy benchmarking
perl-Attribute-Boolean-1.0.8-alt1.noarch.rpm Mark scalars as pure booleans
perl-Attribute-Cached-0.02-alt1.noarch.rpm easily cache subroutines results using a :Cached attribute
perl-Attribute-Constructor-0.04-alt1.noarch.rpm perl module Attribute-Constructor
perl-Attribute-Context-0.042-alt1.noarch.rpm Perl extension for automatically altering subroutine behavior
perl-Attribute-Curried-0.02-alt1.noarch.rpm perl module Attribute-Curried
perl-Attribute-Default-1.35-alt1.noarch.rpm Perl extension to assign default values to subroutine arguments
perl-Attribute-Deprecated-1.04-alt1.noarch.rpm perl module Attribute-Deprecated
perl-Attribute-Exporter-0.01-alt1.noarch.rpm perl module Attribute-Exporter
perl-Attribute-Final-1.3-alt1.noarch.rpm perl module Attribute-Final
perl-Attribute-Generator-0.02-alt1.noarch.rpm Python like generator powered by Coro
perl-Attribute-GlobalEnable-0.01-alt1.noarch.rpm perl module Attribute-GlobalEnable
perl-Attribute-Handlers-Prospective-0.01-alt1.noarch.rpm perl module Attribute-Handlers-Prospective
perl-Attribute-Lexical-0.005-alt1.noarch.rpm sane scoping of function/variable attributes
Advertisement
Advertisement