HOME

TheInfoList



OR:

Dancer is an
open source Open source is source code that is made freely available for possible modification and redistribution. Products include permission to use the source code, design documents, or content of the product. The open-source model is a decentralized sof ...
lightweight
web application framework A web framework (WF) or web application framework (WAF) is a software framework that is designed to support the development of web applications including web services, web resources, and web APIs. Web frameworks provide a standard way to build and ...
written in
Perl Perl is a family of two high-level, general-purpose, interpreted, dynamic programming languages. "Perl" refers to Perl 5, but from 2000 to 2019 it also referred to its redesigned "sister language", Perl 6, before the latter's name was offici ...
and inspired by Ruby's
Sinatra Francis Albert Sinatra (; December 12, 1915 – May 14, 1998) was an American singer and actor. Nicknamed the "Chairman of the Board" and later called "Ol' Blue Eyes", Sinatra was one of the most popular entertainers of the 1940s, 1950s, and ...
. 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
singleton Singleton may refer to: Sciences, technology Mathematics * Singleton (mathematics), a set with exactly one element * Singleton field, used in conformal field theory Computing * Singleton pattern, a design pattern that allows only one instance o ...
s. Development of Dancer1 was at first frozen, but was later continued to maintain
backward compatibility Backward compatibility (sometimes known as backwards compatibility) is a property of an operating system, product, or technology that allows for interoperability with an older legacy system, or with input designed for such a system, especially i ...
for existing apps. Dancer is developed through
GitHub GitHub, Inc. () is an Internet hosting service for software development and version control using Git. It provides the distributed version control of Git plus access control, bug tracking, software feature requests, task management, continuous ...
, with stable releases available via
CPAN The Comprehensive Perl Archive Network (CPAN) is a repository of over 250,000 software modules and accompanying documentation for 39,000 distributions, written in the Perl programming language by over 12,000 contributors. ''CPAN'' can denote eith ...
. Dancer2 is released as a separate module.


Example

#!/usr/bin/env perl use Dancer2; get '/hello/:name' => sub ; get '/redirectMeTo/:trgval' => sub ; start;


Features


Out-of-box

Unlike other frameworks such as
Catalyst Catalysis () is the process of increasing the rate of a chemical reaction by adding a substance known as a catalyst (). Catalysts are not consumed in the reaction and remain unchanged after it. If the reaction is rapid and the catalyst recyc ...
, 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 Plack is a Perl web application programming framework inspired by Rack for Ruby and WSGI for Python, and it is the project behind the PSGI specification used by other frameworks such as Catalyst and Dancer. Plack allows for testing of Perl web ...
specification, and can thus be run on any compliant PSGI server, including Plack,
uWSGI uWSGI is an open source software application that "aims at developing a full stack for building hosting services". It is named after the Web Server Gateway Interface (WSGI), which was the first plugin supported by the project. uWSGI is maintained ...
o
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

*
Comparison of web frameworks Two comparisons of web frameworks are available: * Comparison of JavaScript-based web frameworks (front-end) * Comparison of server-side web frameworks This is a comparison of notable web frameworks, software used to build and deploy web applicat ...


References


External links


Dancer's Homepage

Active Project page on Github

Module on CPAN

The Perl Programming Language

Dancer 2, or Why I Rewrote Everything

Dancer 1 and Dancer 2, what we’re going to do
{{Perl Free software programmed in Perl Perl software Web frameworks