Jump to content

Dancer (software)

From Wikipedia, the free encyclopedia

This is an old revision of this page, as edited by Mortense (talk | contribs) at 09:00, 24 April 2016 (→‎Standalone Development Server: Sentence casing for sub-section titles, as per WP:STYLE.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Dancer
Original author(s)Alexis Sukrieh
Stable release
1.3126 / July 15, 2014; 10 years ago (2014-07-15)
Repository
Written inPerl
Operating systemCross-platform
TypeWeb application framework
LicenseGPL and PAL
Websitewww.perldancer.org

Dancer is an open source lightweight web application framework written in Perl and inspired by Ruby's Sinatra.

In April 2011, Dancer was rewritten from scratch and released as Dancer2. The reason for the rewrite was to fix architectural issues and eliminate the use of singletons.[1] Development of Dancer1 was at first frozen, but was later continued to maintain backward compatibility for existing apps.[2]

Dancer is developed through GitHub, with stable releases available via CPAN. Dancer2 is released as a separate module.

Example

#!/usr/bin/perl
use Dancer;

get '/hello/:name' => sub {
    return "Why, hello there " . params->{name};
};

get '/redirectMeTo/:trgval' => sub {
    redirect request->path_info('/' . params->{trgval});
};

dance;

History

Philosophy

Features

Out-of-box

Unlike other frameworks such as Catalyst, Dancer only requires a handful of CPAN modules and is very self-contained.

Standalone development server

Dancer includes a standalone development server that can be used for developing and testing applications.

PSGI / Plack support

Dancer supports the PSGI specification, and can thus be run on any compliant PSGI server, including Plack, uWSGI or Mongrel 2.

Abstracted

Since most parts of Dancer are abstracted and has a plugin architecture, extending Dancer is fairly straightforward, and a thriving community has sprung up around building these extensions.

Dancer features a lightweight object system, exception throwing similar to Try::Tiny, and is fast, especially in CGI environments.

See also

References

  1. ^ "All About Dancer - In Conversation With Sawyer X Part 2".
  2. ^ "Dancer 1 and Dancer 2, what we're going to do".