Skip to content

Commit

Permalink
documentation tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 7, 2013
1 parent 47f40cd commit 51be24d
Showing 1 changed file with 41 additions and 41 deletions.
82 changes: 41 additions & 41 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -693,6 +693,47 @@ L<Mojolicious/"types">.
app->types->type(rdf => 'application/rdf+xml');
=head2 Static files
Similar to templates, but with only a single file extension and optional
Base64 encoding, static files can be inlined in the C<DATA> section and are
served automatically.
use Mojolicious::Lite;
app->start;
__DATA__
@@ something.js
alert('hello!');
@@ test.txt (base64)
dGVzdCAxMjMKbGFsYWxh
External static files are not limited to a single file extension and will be
served automatically from a C<public> directory if it exists.
$ mkdir public
$ mv something.js public/something.js
$ mv mojolicious.tar.gz public/mojolicious.tar.gz
Both have a higher precedence than routes.
=head2 External templates
External templates will be searched by the renderer in a C<templates>
directory if it exists.
use Mojolicious::Lite;
# Render template "templates/foo/bar.html.ep"
any '/external' => sub {
my $self = shift;
$self->render('foo/bar');
};
app->start;
=head2 Conditions
Conditions such as C<agent> and C<host> from
Expand Down Expand Up @@ -750,47 +791,6 @@ cookies really secure.
app->secret('My secret passphrase here');
=head2 Static files
Similar to templates, but with only a single file extension and optional
Base64 encoding, static files can be inlined in the C<DATA> section and are
served automatically.
use Mojolicious::Lite;
app->start;
__DATA__
@@ something.js
alert('hello!');
@@ test.txt (base64)
dGVzdCAxMjMKbGFsYWxh
External static files are not limited to a single file extension and will be
served automatically from a C<public> directory if it exists.
$ mkdir public
$ mv something.js public/something.js
$ mv mojolicious.tar.gz public/mojolicious.tar.gz
Both have a higher precedence than routes.
=head2 External templates
External templates will be searched by the renderer in a C<templates>
directory.
use Mojolicious::Lite;
# Render template "templates/foo/bar.html.ep"
any '/external' => sub {
my $self = shift;
$self->render('foo/bar');
};
app->start;
=head2 File uploads
All files uploaded via C<multipart/form-data> request are automatically
Expand Down

0 comments on commit 51be24d

Please sign in to comment.