Dancer2 - Lightweight yet powerful web application framework
version 0.02
This is the main module for the Dancer2 distribution. It contains logic for creating a new Dancer2 application.
Dancer2 is the new generation lightweight web-framework for Perl. It's a complete rewrite of Dancer based on Moo.
An application can be as simple as this simple hello world script:
use Dancer2; get '/' => sub { "Hello World" }; dance;
This doc describes the Dancer2 application core and therefore meant for Dancer2 core developers. If you're a user of Dancer2, you should forget about this and read the Dancer2::Manual.
You are also welcome to join our mailing list, and we're also on IRC: #dancer on irc.perl.org.
This subroutine does most of the work.
First it imports strict and warnings.
Then it does the following for these import options:
:moose
No importing of before and after hooks into your namespace. This is to prevent conflict with Moose et al.
before
after
:tests
No importing of pass function. This is to prevent conflict with Test::More et al.
pass
:syntax
Imports syntax only instead of treating your code as a script with command line parameter parsing and built-in web server.
:script
Do not process arguments.
It creates a new runner if one does not exist already.
It will then load additional libraries.
Then create a new Dancer2 app, of type Dancer2::Core::App.
Then it will export all the DSL symbols to the caller.
If any additional argument processing is needed, it will be done at this point.
Returns the current runner. It is of type Dancer2::Core::Runner.
Output a message to STDERR and take further arguments as some data structures using Data::Dumper
Dancer Core Developers
This software is copyright (c) 2013 by Alexis Sukrieh.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Dancer2, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer2
CPAN shell
perl -MCPAN -e shell install Dancer2
For more information on module installation, please visit the detailed CPAN module installation guide.