[dancer-users] Using Dancer2 as a website framework
awitney at sgul.ac.uk
Thu Aug 29 11:31:51 BST 2013
On 28. 8. 2013 18:56, sawyer x wrote:
> Hey Greg,
> I hope it's not too late to chime in.
> On Fri, Aug 23, 2013 at 1:21 PM, Greg Kempe <gregkempe at gmail.com
> <mailto:gregkempe at gmail.com>> wrote:
> We're building a website that wraps functionality exposed by an
> existing Perl EPP library. Perl has great EPP support and we don't
> want to re-implement that library in another language. In the medium
> term, the website will need to offer a fairly rich user experience
> that calls out to other databases and services beyond this one library.
> Sounds good.
> We're exploring two options:
> 1. use Dancer to build the entire website
> 2. use Dancer to power a thin REST API around the library and use
> another framework (eg. in Python) to build the rich website experience.
> Our requirements include:
> * move quickly, use the right tool for the job (ie. favour
> re-using components over building everything from scratch)
> * modern website tooling, such as SASS for CSS, good HTML form
> support, model validation
> * well documented and mature software
> * relatively easy for other devs to work on the project later
> I'm deliberately trying to avoid a language flame war. Rather, I'm
> evaluating based on the size and maturity of the User Experience/UI
> section of the Perl community. Dancer seems well placed for API
> servers, but the web dev communities seem to be focused around Ruby,
> Python, Node etc. which is making me lean toward option (2) above.
> Is that a reasonable evaluation?
> The way I suggest people write their website is by separating the
> application logic from the web layer. I usually implement an API with
> routes defined under MyApp/Web.pm. The rest of MyApp/ contains all the
> application logic that can survive and live without the web layer, if
> needs be.
> In your case, writing just the web layer would be very simple. You could
> then transition it to your use application, written in whatever language
> you want. If you write it correctly, you could switch from Dancer to a
> different web framework (whether in Perl or not).
I'm interested in how exactly you write this API in the web layer, do
you happen to have an example of this approach? or know of a project
that uses it?
Thanks for any help
More information about the dancer-users