You need to define a route handler to deal with those and have Dancer send the file to the client. See the Dancer doc.
Lets the current route handler send a file to the client. Note that the path of the file must be relative to the public directory unless you use the system_path option (see below).
get '/download/:file' => sub { return send_file(params->{file}); }
The directory data
is not included in a standard Dancer installation. You should move the data to public out of security concerns (the doc talks of return send_file('/etc/passwd', system_path => 1);
).
Of course stuff in public
can be downloaded without a route handler. The CSS, JS and dispatch.fcgi
are in there for starters.