Ado::Plugin::Routes - Keep routes separately.
#Open $MOJO_HOME/etc/plugins/routes.conf and describe your routes routes => [ {route => '/ado-users', via => ['GET'], to => 'ado-users#list',}, {route => '/ado-users', via => ['POST'], to => 'ado-users#add',}, ... ], base_url_path =>'/'
Ado::Plugin::Routes allows you to define your routes in a separate file $MOJO_HOME/etc/plugins/routes.conf. In the configuration file you can also use the app keyword and add complex routes as you would do directly in the code.
$MOJO_HOME/etc/plugins/routes.conf
app
Base URL which will be used to construct URLs when deployed as FCGI or CGI. Default: undef.
undef
And ARRAY reference describing the routes.
Ado::Plugin::Routes inherits all methods from Ado::Plugin and implements the following new ones.
This method is called by $app->plugin. Registers the plugin in Ado application and merges routes configuration from $MOJO_HOME/etc/ado.conf with routes defined in $MOJO_HOME/etc/plugins/routes.conf. Routes defined in ado.conf can overwrite those defined in plugins/routes.conf.
$app->plugin
$MOJO_HOME/etc/ado.conf
ado.conf
plugins/routes.conf
This plugin implements the following hooks.
This hook is generated if you add the option base_url_path to plugin configuration. In case the application is deployed as CGI or FCGI application, the url part containing ado is removed from the base url path so the urls are the same as if deployed standalone or with hypnotoad. The configuration for Apache is expected to be generated by Ado::Command::generate::apache2htaccess.
ado
Ado::Command::generate::apache2htaccess, Ado::Command::generate::apache2vhost, Mojolicious::Guides::Routing, Mojolicious::Routes, Ado::Plugin, Ado::Manual::Plugins,Mojolicious::Plugins, Mojolicious::Plugin,
The original author
Красимир Беров (Krasimir Berov)
Copyright 2013-2014 Красимир Беров (Krasimir Berov).
This program is free software, you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License v3 (LGPL-3.0). You may copy, distribute and modify the software provided that modifications are open source. However, software that includes the license may release under a different license.
See http://opensource.org/licenses/lgpl-3.0.html for more information.
To install Ado, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Ado
CPAN shell
perl -MCPAN -e shell install Ado
For more information on module installation, please visit the detailed CPAN module installation guide.