Dancer::Config - Setting registry for Dancer
Setting registry for Dancer
You can change a setting with the keyword set, like the following:
use Dancer; # changing default settings set port => 8080; set content_type => 'text/plain'; set access_log => 0;
A better way of defining settings exists: using YAML file. For this to be possible, you have to install the YAML module. If a file named config.yml exists in the application directory, it will be loaded, as a setting group.
The same is done for the environment file located in the environments directory.
The port Dancer will listen to.
Default value is 3000. This setting can be changed on the command-line with the --port switch.
If set to true, runs the standalone webserver in the background. This setting can be changed on the command-line with the --daemon flag.
The default content type of outgoing content. Default value is 'text/html'.
The default charset of outgoing content. Default value is 'UTF-8'. (not implemented yet)
This is the path of the public directory, where static files are stored. Any existing file in that directory will be served as a static file, before mathcing any route.
By default, it points to APPDIR/public where APPDIR is the directory that contains your Dancer script.
name of the layout to use when rendering view. Dancer will look for a matching template in the directory $appdir/views/layout.
If set to true, tells Dancer to consider all warnings as blocking errors.
Tells which log messages should be actullay logged. Possible values are debug, warning or error.
If set to true, Dancer will render a detailed debug screen whenever an error is catched. If set to false, Dancer will render the default error page, using $public/$error_code.html if it exists.
Requires Module::Refresh.
If set to true, Dancer will reload the route handlers whenever the file where they are defined is changed. This is very useful in development environment but should not be enabled in production. Enabling this flag in production yields a major negative effect on performance because of Module::Refresh.
When this flag is set, you don't have to restart your webserver whenever you make a change in a route handler.
This setting lets you enable a session engine for your web application. Be default, sessions are disabled in Dancer, you must choose a session engine to use them.
See Dancer::Session for supported engines and their respective configuration.
This module has been written by Alexis Sukrieh <sukria@cpan.org> and others, see the AUTHORS file that comes with this distribution for details.
This module is free software and is released under the same terms as Perl itself.
Dancer
To install Dancer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Dancer
CPAN shell
perl -MCPAN -e shell install Dancer
For more information on module installation, please visit the detailed CPAN module installation guide.