External base64 encoded templates in Mojo Lite app

24 views
Skip to first unread message

ty

unread,
Nov 13, 2012, 3:44:10 PM11/13/12
to Mojolicious
Is it possible to use external base64 encoded templates with a Mojo
Lite app? Does anyone have an example?

Best regards,

Ty

ty

unread,
Nov 14, 2012, 11:02:15 AM11/14/12
to Mojolicious
I figured it out

use Mojo::ByteStream 'b';


get '/(:fn).b64' => sub {
my $self = shift;

my $file = $self->param('fn') . '.b64';

$self->render_data(b($file)->slurp->b64_decode->to_string);

};
Reply all
Reply to author
Forward
0 new messages