Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update README.md

Marked up README file.
  • Loading branch information...
commit ee0b0b81b2631b7bbbf1b8314fb583043a89a10f 1 parent 4a6f282
@iiSeymour iiSeymour authored yanick committed
Showing with 67 additions and 70 deletions.
  1. +67 −70 README.md
View
137 README.md
@@ -1,8 +1,8 @@
- Dancer
+## Dancer
- The easiest way to write a webapp with Perl
+The easiest way to write a webapp with Perl
-=== ABOUT ===
+### ABOUT
This project is inspired by Ruby's Sinatra framework: a framework for building
web applications with minimal effort, allowing a simple webapp to be created with
@@ -11,80 +11,81 @@ complex applications. Dancer supports plugins to add various extra
functionality you may want, whilst keeping the core streamlined.
-=== NEWS ===
+### NEWS
-Dancer's development moves very quickly, to stay tuned follow PerlDancer on
-Twitter: http://twitter.com/PerlDancer
+ - Dancer's development moves very quickly, to stay tuned follow PerlDancer on Twitter: http://twitter.com/PerlDancer
+ - See also Sukria's blog: http://www.sukria.net/fr/archives/tag/dancer/
+ - See also the project on Github for the latest changes: http://github.com/PerlDancer/Dancer
+ - To keep even more up to date and talk to the developers, join us in #dancer on
+irc.perl.org *(if you don't have an IRC client, use http://www.perldancer.org/irc
+for easy access)*.
-See also Sukria's blog: http://www.sukria.net/fr/archives/tag/dancer/
+### EXAMPLE
-See also the project on Github for the latest changes:
+To create a new Dancer application, use the helper script `dancer` provided with this distribution:
-http://github.com/PerlDancer/Dancer
+```bash
+$ dancer -a MyWeb::App
++ MyWeb-App/bin
++ MyWeb-App/bin/app.pl
++ MyWeb-App/config.yml
++ MyWeb-App/environments
+[..]
+```
-To keep even more up to date and talk to the developers, join us in #dancer on
-irc.perl.org (if you don't have an IRC client, use http://www.perldancer.org/irc
-for easy access).
-
-=== EXAMPLE ===
-
-To create a new Dancer application, use the helper script "dancer" provided
-with this distribution:
-
- $ 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 'MyWeb::App', which is already a
-functioning "Hello World" application, ready for you to work upon.
+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:
- # MyWeb-App/bin/app.pl
- #!/usr/bin/perl
+```perl
+# MyWeb-App/bin/app.pl
+#!/usr/bin/perl
- use Dancer;
+use Dancer;
- get '/' => sub {
- "Hello There!"
- };
+get '/' => sub {
+ "Hello There!"
+};
- get '/hello/:name' => sub {
- "Hey ".params->{name}.", how are you?";
- };
+get '/hello/:name' => sub {
+ "Hey ".params->{name}.", how are you?";
+};
- post '/new' => sub {
- "creating new entry: ".params->{name};
- };
+post '/new' => sub {
+ "creating new entry: ".params->{name};
+};
- Dancer->dance;
+Dancer->dance;
+```
When running this script, a webserver is running and ready to serve:
- $ perl ./bin/app.pl
- >> Listening on 0.0.0.0:3000
- == Entering the development dance floor ...
+```bash
+$ perl ./bin/app.pl
+>> Listening on 0.0.0.0:3000
+== Entering the development dance floor ...
+```
Then it's possible to access any route defined in the script:
- $ curl http://localhost:3000/
- Hello There!
+```bash
+$ curl http://localhost:3000/
+Hello There!
+```
For a more in-depth example, see examples/dancr
-=== DEPENDENCIES ===
+### DEPENDENCIES
Dancer depends on the following modules
- - HTTP::Server::Simple::PSGI
- - HTTP::Body
- - Exception::Class
- - MIME::Types
- - URI
+ - HTTP::Server::Simple::PSGI
+ - HTTP::Body
+ - Exception::Class
+ - MIME::Types
+ - URI
Optional modules may be needed if you want to use some features (but are not
required for a basic usage).
@@ -93,30 +94,32 @@ Dependency-checks for additional features are performed at runtime.
Most common modules you may want are:
- - Template (for Template::Toolkit support)
- - YAML (for configuration files)
- - Plack (if you want to deploy your application with PSGI)
-
+ - Template (for Template::Toolkit support)
+ - YAML (for configuration files)
+ - Plack (if you want to deploy your application with PSGI)
-=== PRODUCTION MATTERS ===
+### PRODUCTION MATTERS
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:
+your application with the helper script `dancer` like the following:
- $ dancer -a MyWeb::App
+```bash
+$ dancer -a MyWeb::App
+```
-You'll find a file in there called `app.psgi', use this file to configure your
+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
server.
For instance, with plackup, just do the following:
- $ plackup -a app.psgi
-
+```bash
+$ plackup -a app.psgi
+```
-=== WEBSITE ===
+### WEBSITE
For more details about the project, checkout the official website:
http://perldancer.org/ or checkout the documentation at
@@ -125,20 +128,14 @@ http://search.cpan.org/dist/Dancer/
See also the Github project page: http://github.com/PerlDancer/Dancer for the latest
changes.
-
-=== REPORTING BUGS ===
+### REPORTING BUGS
Bug reports are appreciated and will receive prompt attention - the preferred
method is to raise them using Github's basic issue tracking system:
http://github.com/PerlDancer/Dancer/issues
-
-
-=== CONTACT ===
+### CONTACT
You can reach the development team on IRC: irc://irc.perl.org/#dancer or
http://www.perldancer.org/irc for a web-based IRC client.
-
-
-
Please sign in to comment.
Something went wrong with that request. Please try again.