[BACK]Return to dudelicious.pl CVS log [TXT][DIR] Up to [local] / todotxt / Text-Todo / bin

File: [local] / todotxt / Text-Todo / bin / dudelicious.pl (download)

Revision 1.1, Mon Apr 26 19:44:15 2010 UTC (14 years, 2 months ago) by andrew
Branch: MAIN

add dudelicious, a mojolicious lite app that should be able to do all the REST api stuff I want much more easily than I ever could.

#!/usr/bin/env perl

use Mojolicious::Lite;

get '/' => 'index';

get '/:groovy' => sub {
    my $self = shift;
    $self->render_text($self->param('groovy'), layout => 'funky');
};

app->start;
__DATA__

@@ index.html.ep
% layout 'funky';
Yea baby!

@@ layouts/funky.html.ep
<!doctype html><html>
    <head><title>Funky!</title></head>
    <body><%== content %></body>
</html>