Cot::Plugin::Config - Cot configuration plugin
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
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.
Copyright (C) Yusuke Shibata
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Yusuke Shibata <shibata@yusukeshibata.jp>
To install Cot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cot
CPAN shell
perl -MCPAN -e shell install Cot
For more information on module installation, please visit the detailed CPAN module installation guide.