package MyMojoliciousApp::Example; use strict; use warnings; use base 'Mojolicious::Controller'; # This is a templateless action sub test { my ($self, $c) = @_; # Response object my $res = $c->res; # Code $res->code(200); # Headers $res->headers->content_type('text/html'); # Content my $url = $c->url_for; $url->path->parse('/index.html'); $res->body(qq/Forward to a static document.<\/a>/); } # This action will render a template sub welcome { my ($self, $c) = @_; # Render the template $c->render; } 1;