The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

MVC::Neaf::CLI - Command line debugger and runner for Not Even A Framework

DESCRIPTION

Run your applications from command line, with various overrides.

May be useful for command-line mode debugging (think CGI.pm) as well as starting the app from command line.

SYNOPSIS

    perl application.pl --list

Print routes defined in the application.

    perl application.pl --post /foo/bar arg=42

Simulate a request without running a server.

    perl application.pl --listen :5000

Run a psgi server.

OPTIONS

  • --help - display a brief usage message.

  • --list - print routes configured in the application.

  • --listen <port-or-socket> - start application as a standalone plack servers. Any subsequent options compatible with plackup(1) are allowed in this mode.

  • --post - set method to POST.

  • --method METHOD - set method to anything else.

  • --upload id=/path/to/file - add upload. Requires --post.

  • --cookie name="value" - add cookie.

  • --header name="value" - set http header.

  • --view - force (JS,TT,Dumper) view.

METHODS

The usage doesn't expect these are called directly.

But just for the sake of completeness...

run( $app )

Run the application. This reads command line options, as shown in the summary above.

$app is an MVC::Neaf object.

NOTE Spoils @AGRV.

serve( $app, @arg )

Use Plack::Runner to start server.

run_test( $app, %override )

Call MVC::Neaf's run_test.

usage()

Display help message and exit(0).

NOTE exit() used.

list()

List registered Neaf routes.

LICENSE AND COPYRIGHT

This module is part of MVC::Neaf suite.

Copyright 2016-2018 Konstantin S. Uvarin khedin@cpan.org.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.