Rand Stats

Web::App::Ballet

github:raku-community-modules

Web::App::Ballet

Introduction

An extension to [Web::App](https://github.com/raku-community-modules/Web-App /) which adds an interface similar to Dancer or Bailador.

NOTE: I am reworking this module to be merged with Bailador. A lot of Bailador is duplicating the work done in the Web project, and so I have agreed to work with tadzik to merge these two projects together. I am currently adding any of Bailador's features that are missing, and will then work with tadzik to make any transition required to merge the projects.

Supported Transports

Technically, it can use any backend transport that Web::App supports, but there are only convenience wrappers provided for the following:

Supported Template Engines

We are using [Web::Template](https://github.com/raku-community-modules/Web -Template/) as our template engine abstraction layer, and will support any engines that it has wrapper classes for. The currently supported libraries are:

Example Application Script

  use Web::App::Ballet;

  use-template6; ## We're explicitly setting the template engine.

  get '/' => sub ($c) {
    $c.content-type: 'text/plain';
    my $name = $c.get(:default<World>, 'name');
    $c.send("Hello $name"); ## Explicit context output specified.
  }

  get '/perl6' => 'http://perl6.org/'; ## A redirect statement.

  get '/hello/:name' => sub ($c) {
    my $name = $c.get(':name'); ## get the placeholder path.
    $c.send(template('hello', :$name)); ## Explicit template output.
  }

  get '/about' => sub ($c) {
    template 'about', :ver<1.0.0>; ## Implicit template output.
  }

  dance; ## Start the process.

TODO

Author

Timothy Totten -- supernovus on #raku

License

Artistic License 2.0