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
3
votes
1 answer

Installing latest version of Dancer2 on Debian

OK, got myself a clean virtual machine running Debian 9 (Stretch). I installed Dancer2 from the Debian package system. It's running version 0.204002. The Dancer2 software is telling me that the latest version is 0.205002. I want to finally, once and…
StevieD
  • 6,925
  • 2
  • 25
  • 45
3
votes
1 answer

How to access Dancer2's session object?

I'm using Dancer2 and the YAML session engine for my web app. My config.yml contains engines: session: YAML: ... cookie_duration: 5 minutes ... I'd like to display something like "Your session expires in X minutes". How can…
PerlDuck
  • 5,610
  • 3
  • 20
  • 39
3
votes
0 answers

Dancer2 application: streaming content blocks server and client. How to avoid blocking?

tl;dr I'm streaming content with Dancer2's keywords delayed, flush, content, done and it blocks the server while streaming until I call done. How can I avoid that? More detailed I wrote a Dancer2 application that calls an external command (a…
PerlDuck
  • 5,610
  • 3
  • 20
  • 39
3
votes
1 answer

Dancer2: fetching nested data from hash stored in YAML session

I'm using Dancer2 and the YAML session engine. I stored a complete hash in a session with the following code: post '/login' => sub { # ... my $userdata = { fname => 'John', lname => 'Doe', uid => 1234, }; #…
PerlDuck
  • 5,610
  • 3
  • 20
  • 39
3
votes
1 answer

How to put a specific message in the "response body" of a perl Dancer server

My RESTfull server with Perl Dancer runs perfectly with one exception: send_error("Simple Error string",400) for example removes the error message. The error code will be sent, but without the actual message "Simple Error string". I tried return…
cablebuddy
  • 33
  • 6
3
votes
1 answer

PERL Dancer2, cgi dispatcher and uri_for helper

I have a web interface that i need to maintain and improve, written in a plain old CGI.pm way. That app is not using templating system neither. It's served by apache, like that: /var/www/vhost/myapp/cgi-bin/app.cgi …
3
votes
2 answers

A Simple Login/Authorization system using Dancer and Postgres

As a newbie to Perl I'm struggling to find a simple way to do this. I've created a very simple table in my database: CREATE TABLE users ( id SERIAL NOT NULL PRIMARY KEY, username TEXT NOT NULL, password TEXT NOT NULL); So far I used a simple…
vanilla_splsh
  • 153
  • 1
  • 12
3
votes
1 answer

How can I use XML serializer in Perl Dancer2?

In Dancer you can use: set serializer => 'Mutable'; or set serializer => 'XML' Dancer2: set serializer => 'XML' you got Unable to load class for Serializer component XML: Can't locate Dancer2/Serializer/XML.pm There is no…
Gerd
  • 2,265
  • 1
  • 27
  • 46
3
votes
1 answer

Perl Dancer or Node.js for small application

I am using Perl Dancer to develop an application handling minimal routes and requests. What is the difference between Perl Dancer (micro web framework) and Node.js ? which ll be better Node.js or Perl Dancer?
user_D_A__
  • 460
  • 2
  • 6
  • 14
3
votes
1 answer

How do I setup my server with https and perl Dancer as a standalone server?

We need to create a quick demo of a web service using Perl's Dancer as a standalone webserver, and Twitter API. Unforunately, Twitter API only allows https/ssl requests but I have no idea how to set this up on a server that isn't using Apache. I…
qodeninja
  • 10,946
  • 30
  • 98
  • 152
3
votes
1 answer

Perl Dancer: Instant response in post

I have a site running Dancer. In this site, i have a form with one textarea, and foreach line written in this textarea, when the form is submitted via post, i do some action for it. Each line starts a process, and it takes some time ( depending of…
user3452713
  • 140
  • 6
3
votes
1 answer

Perl Dancer index.cgi for all requests

I am trying to use the Perl Dancer module in my first application. The first application created a file called MyWeb-App/bin/app.pl which contains this code: use Dancer; use MyWeb::App; dance; and a file called MyWeb-App/lib/MyWeb/App.pm contains…
daliaessam
  • 1,636
  • 2
  • 21
  • 43
3
votes
3 answers

Dancer Hooks on a per-request method basis?

I'm working on a CRUD application using Dancer. One of the things I need to do is check a user is authorized to perform POST (create) and PUT (update) / DELETE (remove) operations. I've read up on before hooks in the Dancer documentation, but have…
Glitch Desire
  • 14,632
  • 7
  • 43
  • 55
3
votes
1 answer

Where in my Dancer app should I use modules that are needed for objects restored from the session?

I use some Moose objects that I retrieve from Redis. I wrote code that figures out the right classes and and loads them on demand. Now I store those in the session as well, and when they get restored (by the Session engine and not my own Redis…
simbabque
  • 53,749
  • 8
  • 73
  • 136
3
votes
1 answer

Is an HTTP Server a Good Idea For IPC?

I need to implement a tool which gets its data from running processes,in a POST/GET mechanism. The amount of connections between the client/server is quite low - One request per minute on average. The default way is to implement a simple server…
Mattan
  • 733
  • 7
  • 19