John Scoles
and 1 contributors


Mojolicious::Command::generate::routes_restsful - Generate an App from a Mojolicious::Plugin::Routes::Restful HASH


  my $commands = Mojolicious::Commands->new;
  my $gen = Mojolicious::Command::generate::routes_restsful->new;
            CONFIG => { Namespaces => ['RouteRestfulApp::Controller'] },
            PARENT => {...


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.


Mojolicious::Command::generate::app inherits all attributes from Mojolicious::Command and implements the following new ones.


  my $description = $app->description;
  $app            = $app->description('Foo');

Short description of this command, used for the command list.


  my $usage = $app->usage;
  $app      = $app->usage('Foo');

Usage information for this command, used for the help screen.


Mojolicious::Command::generate::routes_restsful inherits all methods from Mojolicious::Command and implements the following new ones.



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.


Mojolicious, Mojolicious::Guides,, Mojolicious::Plugin::Routes::Restful.