Ado

 view release on metacpan or  search on metacpan

etc/ado.conf  view on Meta::CPAN

#See /perldoc/Mojolicious#secrets
#app->secrets([Mojo::Util::sha1_sum($mode . $home),]);

#Application/site specific templates
#See /perldoc/Mojolicious/Renderer#paths
#unshift @{app->renderer->paths}, $home->rel_dir('site_templates');

#Application specific static files
#See /perldoc/Mojolicious/Static
#It is better to leave static files to be served by a server like Apache
#This setting can be used during development.
#unshift @{$app->static->paths},   app->home->rel_dir('path/to/other/public/files');


#Setting the Controller class from which all controllers must inherit.
#See /perldoc/Mojolicious/#controller_class
#See /perldoc/Mojolicious/Guides/Growing#Controller_class
app->controller_class('Ado::Control');

#Namespace(s) to load controllers from
#See /perldoc/Mojolicious#routes
#app->routes->namespaces(['Ado::Control']);

#Namespaces to load plugins from
#See /perldoc/Mojolicious#plugins
#See /perldoc/Mojolicious/Plugins#PLUGINS
#app->plugins->namespaces(['Mojolicious::Plugin', 'Ado::Plugin',]);


#Ado namespace to load commands from
#See /perldoc/Mojolicious/#commands
#See /perldoc/Ado/Command
#unshift @{app->commands->namespaces}, 'Ado::Command';

# Add custom MIME type
#See /perldoc/Mojolicious/#types
#app->types->type(twt => 'text/tweet');

#Stash defaults. See /perldoc/Mojolicious/#defaults
my $sui_path = 'vendor/SemanticUI/components';
app->defaults(
    layout   => 'default',
    sui_path => $sui_path,
    head_css => [
        $sui_path . '/reset.min.css',
        $sui_path . '/site.min.css',
        $sui_path . '/transition.min.css',
    ],
    head_javascript => [
        'mojo/jquery/jquery.js',

        #TODO: report problem with easing when loading separate js components
        $sui_path . '/transition.min.js',
    ]
);

{

    # Hypnotoad Settings (optimized for blocking operations)
    # See /perldoc/Mojo/Server/Hypnotoad#SETTINGS
    # and /perldoc/Mojolicious/Guides/Cookbook#Hypnotoad
    hypnotoad => {

        #listen  => ['http://*:9090'],
        #proxy   => 1,
        workers => 20,
        clients => 1,
    },
    session => {

        #Type of the session this application will use
        #Possible values are:
        # 'file'(Ado::Sessions::File),
        # 'database'(Ado::Sessions::Database),
        # 'mojo'(Mojolicious::Sessions)
        type => 'database',

        #Every sessions implementations has its own options
        options => {
            cookie_name        => $moniker,
            default_expiration => 86400,
        }
    },

    #Plugins can be Mojolicious and Ado plugins.
    # Every Ado::Plugin:: ISA Mojolicious::Plugin
    #Plugin order is important. Any plugin depending on another
    # must come after the plugin it depends on.
    #A plugin may be loaded twice if it will do different
    # things depending on configuration variables.
    # See localhost:3000//perldoc/Mojolicious/Plugin/DSC
    # By loading Mojolicious::Plugin::DSC more than once and providing
    # different dbix_helper for each connection  we can connect to
    # different databases.

    #See /perldoc/Ado#load_plugins
    plugins => [
        'PODRenderer',
        {   name   => 'DSC',
            config => {
                database       => $database_file,
                dbh_attributes => {sqlite_unicode => 1},
                driver         => 'SQLite',
                namespace      => 'Ado::Model',
                onconnect_do   => [

                    #Database engine specific code here.
                    #See /perldoc/Mojolicious/Plugin/DSC#onconnect_do
                    #Replace it with something else if using MySQL or PostgreSQL
                    #http://www.sqlite.org/pragma.html
                    'PRAGMA encoding = "UTF-8"',
                    'PRAGMA foreign_keys = ON',
                    'PRAGMA temp_store = MEMORY',
                    'PRAGMA synchronous = OFF',
                    'PRAGMA journal_mode=WAL',

                    #http://www.sqlite.org/lang_vacuum.html
                    #'VACUUM',
                    #Execute any arbitrary Perl code
#https://metacpan.org/pod/DBD::SQLite#dbh-sqlite_create_function-name-argc-code_ref
                    sub {



( run in 1.937 second using v1.01-cache-2.11-cpan-39bf76dae61 )