Questions tagged [dancer]

Dancer is a lightweight yet powerful web application framework for Perl, inspired by Sinatra. It aims to be simple, flexible, and easy to get to grips with.

Dancer is a micro web application framework for Perl, originally inspired by the Sinatra framework in Ruby.

Dancer is designed to be as effortless as possible for the developer, taking care of the boring bits as easily as possible, yet staying out of your way and letting you get on with writing your code.

Dancer offers the flexibility to scale between a very simple lightweight web service consisting of a few lines of code in a single file, all the way up to a much more complex fully-fledged web application with session support, templates for views and layouts, etc.

There are a wide variety of Dancer plugins available on CPAN to make common tasks easy (for example, database access, sending email, sending SMS text messages, interacting with Facebook).

There are also various template engine wrappers available for common templating engines such as Template Toolkit, HTML::Template, Mason and many more; writing additional wrappers for new templating engines is easy too.

Getting help

Dancer developers tend to monitor questions on Stackoverflow tagged 'dancer'.

There is an active IRC community on irc.perl.org/#perl (web chat client available).

There's also a mailing list.

Related tags:

264 questions
6
votes
1 answer

Why Dancer app fails under uWSGI + Apache?

My Dancer app fails under uWSGI (2.0.7) + Apache (2.4.10) combination while it runs freely in other environments ( uWSGI + nginx, Starman + Apache, Dancer own dev-server). I don't find in logs any meaningful information. So I made simple test app…
w.k
  • 8,218
  • 4
  • 32
  • 55
6
votes
2 answers

Configure Dancer from environment variables?

I'm new to Dancer, but I'm trying to configure it to work within a Docker container. As a result, I need to pick up my database settings from the environment. In my case, I have DB_PORT_3306_TCP_ADDR, and DB_PORT_3306_TCP_PORT coming from Docker. …
Jack M.
  • 30,350
  • 7
  • 55
  • 67
6
votes
1 answer

Can I instantiate an object in Dancer to return a value to display?

I have the following code in my Dancer app module: package Deadlands; use Dancer ':syntax'; use Dice; our $VERSION = '0.1'; get '/' => sub { my ($dieQty, $dieType); $dieQty = param('dieQty'); $dieType = param('dieType'); if…
BackPacker777
  • 673
  • 2
  • 6
  • 21
6
votes
2 answers

Killing Long Running Fastcgi Processes

I have a Perl Dancer web application which uses the mod_fastcgi serving method from Apache2. The application has to accept uploaded files. When a user is uploading a file and presses the stop button, the fastcgi process hangs, running at 100% until…
mbergins
  • 61
  • 4
5
votes
3 answers

Multiple app directories with Dancer perl

Is there a way to have one app in dancer but with multiple appdirs. Or could I do something like this: My project is in dir 'foo'. And let's say that I have a dir 'bar' (not inside 'foo') which has a directory called 'public'. I what my app 'foo' to…
bliof
  • 2,957
  • 2
  • 23
  • 39
5
votes
1 answer

How do I configure Dancer2 and Template Toolkit to use a different Stash module

How would I modify the default configuration of Template Toolkit in a Dancer2 site to make use of Template::Stash::AutoEscaping?
Cebjyre
  • 6,552
  • 3
  • 32
  • 57
5
votes
1 answer

How can I attach a debugger to a Dancer2 application

Please bear with me, because I don't really know the first thing about Dancer2, other than the fact that I've inherited something written with it. I want to attach a regular debugger to it, and it's valiantly resisting most of my attempts. Say I…
badp
  • 11,409
  • 3
  • 61
  • 89
5
votes
1 answer

systemd service for a perlbrew application?

My coworker wrote a Dancer psgi application called "Newlands" that makes use of perlbrew. I am trying to get the application to start up on system start using systemd. I have this service…
5
votes
1 answer

Dancer unique request ID

Is there any unique request ID in Dancer? Apache has mod_unique_id: http://httpd.apache.org/docs/current/mod/mod_unique_id.html PSGI/Plack has a middleware module:…
Sebastian
  • 2,472
  • 1
  • 18
  • 31
5
votes
2 answers

Perl Dancer Template headers, footers

I'm learning Perl and using Dancer as a web framework. I've got two views (tt files) which should share the same navigation. So, it would be great to start learning how to manage templates for navigation and footers. I've read the documentation…
Chüngel
  • 375
  • 4
  • 19
5
votes
1 answer

Perl - Template Toolkit - How get list of variables in the template?

I am using Perl with Dancer and Template::Toolkit. I'm trying to create a generic routine that will be passed a template and the HTTP GET/POST parameters. I need to find a way to get a list of the variables in the template, so I can retrieve them…
Douglas Mauch
  • 859
  • 2
  • 7
  • 18
5
votes
1 answer

Dancer randomly hangs when reading GET request

I am playing with perl dancer on Linux and all is nice and dany if the browser connects to the server directly via LAN. However, when I connect via WAN and the browser is IE9, then occasionally the busy cursor won't go away. I can provoke this, by…
Martin Drautzburg
  • 5,143
  • 1
  • 27
  • 39
5
votes
2 answers

perl dancer - how pass additional arguments to method hander subroutines?

Is there a way to pass additional variables to a method handler subroutine? I generally dislike using global variables outside the subroutine's scope. I have things like database connection and class instances which I would like the handlers to…
Douglas Mauch
  • 859
  • 2
  • 7
  • 18
5
votes
1 answer

Perl Dancer Auth Solution that Supports API Keys?

I have a dancer web application that is part web-site and part web-service; certain routes on my application should have auth on them. All the auth solutions I've found for a Dancer web app require the redirection to a login page; while this is okay…
Blaskovicz
  • 6,122
  • 7
  • 41
  • 50
5
votes
3 answers

Perl Dancer trailing slash

Using the Perl web application framework Dancer, I am having some problems with trailing slashes in the URL matching. Say for example, I want to match the following URL, with an optional Id parameter: get '/users/:id?' => sub { #Do…
Morgan Bengtsson
  • 1,341
  • 1
  • 14
  • 23
1
2
3
17 18