Dancer (software)
   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 and view the source code, design documents, or content of the product. The open source model is a decentrali ...
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 high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language". Perl was developed ...
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
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 ...
s. Development of Dancer1 was at first frozen, but was later continued to maintain
backward compatibility In telecommunications and computing, backward compatibility (or backwards compatibility) is a property of an operating system, software, real-world product, or technology that allows for interoperability with an older legacy system, or with Input ...
for existing apps. Dancer is developed through
GitHub GitHub () is a Proprietary software, proprietary developer platform that allows developers to create, store, manage, and share their code. It uses Git to provide distributed version control and GitHub itself provides access control, bug trackin ...
, with stable releases available via
CPAN The Comprehensive Perl Archive Network (CPAN) is a software repository of over 220,000 software modules and accompanying documentation for 45,500 distributions, written in the Perl programming language by over 14,500 contributors. ''CPAN'' can de ...
. 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 increase in rate of a chemical reaction due to an added substance known as a catalyst (). Catalysts are not consumed by the reaction and remain unchanged after it. If the reaction is rapid and the catalyst recycles quick ...
, 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 w ...
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 maintaine ...
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 This is a comparison of web frameworks for front-end web development that are reliant on JavaScript code for their behavior. General in ...


References


External links

* * **
Module on CPAN

Dancer 2, or Why I Rewrote Everything
* {{Perl Free software programmed in Perl Perl software Web frameworks