Yusuke Shibata > Cot > Cot::Plugin::Config

Download:
Cot-0.11.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.11   Source  

NAME ^

Cot::Plugin::Config - Cot configuration plugin

SYNOPSIS ^

For example,

    use Cot;
    use Cot::Plugin qw/Config/;

    get "/test" => sub {
        my $self = shift;
        my $db = $self->config->{'db'};
        ...
    };

Config yaml file($ENV{COT_ROOT}/config.yaml) is,

    development:
      db: dbi:mysql:diary:localhost

    production:
      db: dbi:mysql:diary:192.168.1.10

DESCRIPTION ^

Cot::Plugin::Config is an only build in Plugin is Cot framework. You can descsribe Config file(config.yaml) and call config method of Cot object. return the hash reference of config.yaml file $ENV{COT_ENV} entries data.

LICENSE ^

Copyright (C) Yusuke Shibata

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

AUTHOR ^

Yusuke Shibata <shibata@yusukeshibata.jp>

syntax highlighting: