Ado

 view release on metacpan or  search on metacpan

etc/ado.conf  view on Meta::CPAN

    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 {
                        my $dbh = shift->dbh;
                        $dbh->sqlite_create_function('upper', 1, sub { uc(shift) });
                        $dbh->sqlite_create_function('lower', 1, sub { lc(shift) });
                    },
                ],
                DEBUG => 0,
            },
        },
        'SemanticUI',

        #These are Ado plugins, loading their own config files.
        'ado_helpers',
        'markdown_renderer',
        'auth',
        'i18n',

        #'admin',
        #'vest',
        #'blog',
        #put your own routes for your private code in
        # etc/plugins/routes.$mode.conf
        'routes',
    ],

    #Configuration for commands
    #Every Ado::Command:: ISA Mojolicious::Command
    commands => {},

    #Routes order is important, so this configuration value is an ARRAYREF
    #Routes added by plugins will be checked for match before these routes here.
    routes => [
        {   route => '/',
            via   => [qw(GET OPTIONS)],

            #Ado::Control::Default::index()
            to => 'default#index',
        },

    ],    #end routes

    #MIME types



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