Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 1449a3a4fc
Fetching contributors…

Cannot retrieve contributors at this time

139 lines (90 sloc) 3.928 kb
TODO
This is the roadmap of upcoming developments
* Route caching support
When a path is firstly resolved through the route tree, we should
cache the result for future calls.
The path would be the cache key, the first route the value.
1 - GET / -> first call, so browse the route tree
2 - GET / -> second call, return cache('/');
* Conditions support for route matching:
get '/foo', {agent => 'Songbird (\d\.\d)[\d\/]*?'} => sub {
...
};
* Helper script
We need an helper script for providing a bootstraping method for
creating new applications.
The helper script should be named dancer, and would be usable
like the following:
$ dancer --help
dancer - helper script for bootstraping Dancer web applications
Usage: dancer [options] <appname>
Create the directory `appname' according to the given options.
Options:
--template create a views directory and make sure
Template is installed.
--logger make sure Logger::Syslog is installed and
enable the logger in the app.
Here is the output of the command:
$ dancer --template /srv/webapps/myblog
+ creating /srv/webapps/myblog
+ creating /srv/webapps/myblog/public
+ creating /srv/webapps/myblog/public/errors
+ creating /srv/webapps/myblog/public/errors/500.html
+ creating /srv/webapps/myblog/public/errors/404.html
+ creating /srv/webapps/myblog/public/errors/503.html
+ creating /srv/webapps/myblog/public/css
+ creating /srv/webapps/myblog/public/css/style.css
+ creating /srv/webapps/myblog/views
+ creating /srv/webapps/myblog/views/layouts
+ creating /srv/webapps/myblog/views/layouts/main.tt
+ creating /srv/webapps/myblog/myblog-server.pl
+ creating /srv/webapps/myblog/environment.pl
+ creating /srv/webapps/myblog/environments/
+ creating /srv/webapps/myblog/environments/production.pl
+ creating /srv/webapps/myblog/environments/development.pl
* Error handler support
It should be possible to handle errors in two different ways.
- detailed: when an error occurs, Dancer renders a page with as
many details as it can concerning the error
- hidden: when an error occurs, a generic page is sent to the
user describing the kind of error. This is done with a
send_file statement, using views/error/ERRCODE.html
These error rendering modes should be set through the
'errors' setting :
set errors => detailed;
or
set errors => hidden;
* Environment support
It should be possible to run a Dancer server with a specific
environment, like development or production.
This could be done like the following:
$ ./my-dancer-app.pl --environment production
Then the script appdir/environments/development.pl would be
loaded.
Content for environments/development.pl
set access_log => true;
set verbosity => true;
set errors => detailed;
set port => 3000;
end;
Content for environments/production.pl
set access_log => true;
set verbosity => false;
set errors => hidden;
set port => 3000;
end;
The environments files are pure Perl files, they are loaded with
the require mechanism, so the can be written with the Dancer
syntax.
The `end' keyword just returns true, it's sugar for configuration
files.
* Logger
we should provide the option to use a logger, like
Logger::Syslog. Can be defined with a setting:
set log => debug;
or
set log => warning;
A wrapper, Dancer::Logger would then provide the following
methods: debug, warning and error.
If the log setting is at least the level requested, it logs the
message, otherwise, it drops it out.
Jump to Line
Something went wrong with that request. Please try again.