From b1df908e8020c1eb6b5f16b00fc23c55bcaa9ecf Mon Sep 17 00:00:00 2001 From: pdl Date: Fri, 17 Aug 2012 12:51:54 +0200 Subject: [PATCH 1/2] Show double-colon invocation; fix init path Showing `dancer -a MyWeb::App` rather than `dancer -a mywebapp` is more useful (and is used on [the Dancer Website](http://perldancer.org)). The example also incorrectly lists `./mywebapp.pl` as the invocation script instead of `./bin/app.pl`. --- script/dancer | 65 +++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 31 deletions(-) diff --git a/script/dancer b/script/dancer index d9b9f8573..8043b511d 100755 --- a/script/dancer +++ b/script/dancer @@ -1483,40 +1483,43 @@ the framework for a new Dancer application. Here is an application created with dancer: - $ dancer -a mywebapp - + mywebapp - + mywebapp/bin - + mywebapp/bin/app.pl - + mywebapp/config.yml - + mywebapp/environments - + mywebapp/environments/development.yml - + mywebapp/environments/production.yml - + mywebapp/views - + mywebapp/views/index.tt - + mywebapp/views/layouts - + mywebapp/views/layouts/main.tt - + mywebapp/lib - + mywebapp/lib/mywebapp.pm - + mywebapp/public - + mywebapp/public/css - + mywebapp/public/css/style.css - + mywebapp/public/css/error.css - + mywebapp/public/images - + mywebapp/public/500.html - + mywebapp/public/404.html - + mywebapp/public/dispatch.fcgi - + mywebapp/public/dispatch.cgi - + mywebapp/public/javascripts - + mywebapp/public/javascripts/jquery.js - + mywebapp/Makefile.PL - + mywebapp/t - + mywebapp/t/002_index_route.t - + mywebapp/t/001_base.t + $ dancer -a MyWeb::App + + MyWeb-App + + MyWeb-App/bin + + MyWeb-App/bin/app.pl + + MyWeb-App/config.yml + + MyWeb-App/environments + + MyWeb-App/environments/development.yml + + MyWeb-App/environments/production.yml + + MyWeb-App/views + + MyWeb-App/views/index.tt + + MyWeb-App/views/layouts + + MyWeb-App/views/layouts/main.tt + + MyWeb-App/MANIFEST.SKIP + + MyWeb-App/lib + + MyWeb-App/lib/MyWeb + + MyWeb-App/lib/MyWeb/App.pm + + MyWeb-App/public + + MyWeb-App/public/css + + MyWeb-App/public/css/style.css + + MyWeb-App/public/css/error.css + + MyWeb-App/public/images + + MyWeb-App/public/500.html + + MyWeb-App/public/404.html + + MyWeb-App/public/dispatch.fcgi + + MyWeb-App/public/dispatch.cgi + + MyWeb-App/public/javascripts + + MyWeb-App/public/javascripts/jquery.js + + MyWeb-App/t + + MyWeb-App/t/002_index_route.t + + MyWeb-App/t/001_base.t + + MyWeb-App/Makefile.PL + The application is ready to serve: - $ cd mywebapp - $ ./mywebapp.pl + $ cd MyWeb-App + $ ./bin/app.pl >> Listening on 127.0.0.1:3000 == Entering the development dance floor ... From 8c495894ecdef9ea1e0ca09172712af37091d7a7 Mon Sep 17 00:00:00 2001 From: pdl Date: Fri, 17 Aug 2012 12:57:59 +0200 Subject: [PATCH 2/2] Show double-colon invocation; fix init path Showing `dancer -a MyWeb::App` rather than `dancer -a mywebapp` is more useful (and is used on [the Dancer Website](http://perldancer.org)). The example also incorrectly lists `./mywebapp.pl` as the invocation script instead of `./bin/app.pl`. --- README | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/README b/README index 7f874055c..8a314d85d 100644 --- a/README +++ b/README @@ -31,19 +31,19 @@ for easy access). To create a new Dancer application, use the helper script "dancer" provided with this distribution: - $ dancer -a mywebapp - + mywebapp - + mywebapp/config.yml - + mywebapp/views - + mywebapp/views/layouts + $ dancer -a MyWeb::App + + MyWeb-App/bin + + MyWeb-App/bin/app.pl + + MyWeb-App/config.yml + + MyWeb-App/environments [..] -You then have a new Dancer application in 'mywebapp', which is already a +You then have a new Dancer application in 'MyWeb::App', which is already a functioning "Hello World" application, ready for you to work upon. Here is an example of a webapp built with Dancer: - # webapp.pl + # MyWeb-App/bin/app.pl #!/usr/bin/perl use Dancer; @@ -64,7 +64,7 @@ Here is an example of a webapp built with Dancer: When running this script, a webserver is running and ready to serve: - $ perl ./webapp.pl + $ perl ./bin/app.pl >> Listening on 0.0.0.0:3000 == Entering the development dance floor ... @@ -105,7 +105,7 @@ This is a work in progress. Dancer supports PSGI/Plack, to run a Dancer app with PSGI/Plack just bootstrap your application with the helper script `dancer' like the following: - $ dancer -a MyWebApp + $ dancer -a MyWeb::App You'll find a file in there called `app.psgi', use this file to configure your PSGI environment, as explained in the revelant documentation of your PSGI