Single Page Applications heavily rely on some JavaScript framework and a back-end system that can provide communication using JSON.

AngularJS is a great JavaScript framework (or HTML framework, or whatever you might want to call it), and Perl Dancer is a nice backend framework.

Recent versions of Dancer2 started to allow custom skeletons which means, we can provide our own skeleton files and the new Dancer-based application will use those.

The Dancer2-Angular-Skeleton is such a set of files.

Download the skeleton using the Download ZIP button in the GitHub Repository. And unzip the file.

$ wget
$ unzip
$ dancer2 -a My::App -s Dancer2-Angular-Skeleton-master

Due to a bug for which I sent in a pull request already it will complain a bit with hundreds of rows like this:

utf8 "\xAC" does not map to Unicode a ...

but in the end it will create a directory called My-App, and in that directory you'll have Dancer2 application, AngularJS, and a few lines of code that demonstrates how to get started with a Single-Page Application.

It still needs more work, but I really wanted to show it already.

You can now

$ cd My-App
$ plackup -R lib bin/app.psgi

and visit to see how does it work.

Creating your own Dancer2 skeleton

It is quite easy. You can clone the one I have created, or you can copy the share/skel directory from the Dancer2 distribution and tweak it for yourself.