Skip to content

Commit

Permalink
show how to create an index.html alias
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 6, 2015
1 parent d15cb5c commit 2622ee0
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

6.02 2015-03-04
6.02 2015-03-06

6.01 2015-03-03
- Added content_with helper to Mojolicious::Plugin::DefaultHelpers.
Expand Down
7 changes: 6 additions & 1 deletion lib/Mojolicious/Guides/Rendering.pod
Expand Up @@ -1017,7 +1017,12 @@ L<Mojolicious::Plugin::DefaultHelpers/"reply-E<gt>static">.

use Mojolicious::Lite;

get '/some_static_file' => sub {
get '/' => sub {
my $c = shift;
$c->reply->static('index.html');
};

get '/some_download' => sub {
my $c = shift;
$c->res->headers->content_disposition('attachment; filename=bar.png;');
$c->reply->static('foo/bar.png');
Expand Down

0 comments on commit 2622ee0

Please sign in to comment.