[dancer-users] dancer2 gen

Brendon Oliver brendon.oliver at gmail.com
Wed Jan 7 01:07:53 GMT 2015

Hi all,

I've recently been looking at migrating a small Dancer1 app of mine to
Dancer2.  I noticed a couple of small issues with tinkering with 'dancer2
gen ...':

- it creates both bin/app.pl and bin/app.psgi which are identical, but the
dancer2 man page only refers to bin/app.psgi.  I'd suggest either removing
generation of bin/app.pl or covering it in the doco.  Related issue: if bin/
app.pl is kept, then for it to be started just with a simple ./bin/app.pl
the final statement in the script would need to call either ->start() or
->dance() on the module instead of ->to_app().

- also from the dancer2 man page:

       The application is ready to serve:

           $ cd MyWeb-App
           $ plackup bin/app.psgi
           >> Listening on
           == Entering the development dance floor ...

... this is a little mis-leading: plackup uses port 5000 by default.  Also
the startup output produced by plackup is a little different:
           $ plackup bin/app.psgi
           HTTP::Server::PSGI: Accepting connections at http://0:5000/
Again, if both the generated .pl / .psgi scripts are both kept, then I
think they ought to at least both start on the same port for consistency
(I'm presuming a developer would normally use one or the other, not both at
the same time).

- 'gen' also has a -d option which isn't mentioned in the man page. Also,
not cluing into the docs properly, I inadvertently gave an absolute path to
-d (dancer2 gen -d /some/long/path -a Foo) -  and ended up with my Foo app
being created in `pwd`/some/long/path. I don't know if it's intentional or
not, but I think maybe -d should blow up if given a string that looks like
an absolute path (or maybe conflate the -p / -d options into a single
option which "does the right thing").



- Brendon.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.preshweb.co.uk/pipermail/dancer-users/attachments/20150107/232cb170/attachment.html>

More information about the dancer-users mailing list