NAME
Mojolicious::Command::generate::routes_restsful - Generate an App from a Mojolicious::Plugin::Routes::Restful HASH
SYNOPSIS
my $commands = Mojolicious::Commands->new;
my $gen = Mojolicious::Command::generate::routes_restsful->new;
$gen->run('RoutesRestfulApp',{
CONFIG => { Namespaces => ['RouteRestfulApp::Controller'] },
PARENT => {...
DESCRIPTION
Give Mojolicious::Command::generate::routes_restsful a hash that was created for Mojolicious::Plugin::Routes::Restful and it will generate a stub site for you. You get a stub working in version of your app made up of
An App Class
Content Contollers
API Controllers
A Startup Script
A Template set based on your content controlers
A basic test suite for your API
Please note that this generator overwrites the NAMESPACE attribute of you hash. It is not intended to use this generator from the command line. Best to use it in a script. See the script dir for an example.
See Mojolicious::Plugin::Routes::Restful for details on how to make a Hash for this generator.
ATTRIBUTES
Mojolicious::Command::generate::app inherits all attributes from Mojolicious::Command and implements the following new ones.
description
my $description = $app->description;
$app = $app->description('Foo');
Short description of this command, used for the command list.
usage
my $usage = $app->usage;
$app = $app->usage('Foo');
Usage information for this command, used for the help screen.
METHODS
Mojolicious::Command::generate::routes_restsful inherits all methods from Mojolicious::Command and implements the following new ones.
run
$app->run($class,$hash);
Generates the App. Where $class is the name of the App you want to create, and $hash is a valid Mojolicious::Plugin::Routes::Restful hash.
SEE ALSO
Mojolicious, Mojolicious::Guides, http://mojolicious.org, Mojolicious::Plugin::Routes::Restful.