Skip to content

Commit

Permalink
better description for static file handling in the tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 7, 2013
1 parent c3afdee commit 70080e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,6 +1,7 @@

3.94 2013-04-06
3.94 2013-04-07
- Removed deprecated start method from Mojolicious::Commands.
- Improved documentation.

3.93 2013-04-05
- Deprecated Mojo::IOLoop::Delay::end in favor of generated callbacks.
Expand Down
14 changes: 12 additions & 2 deletions lib/Mojolicious/Lite.pm
Expand Up @@ -852,17 +852,27 @@ directory.
=head2 Static files
Static files will be automatically served from the C<DATA> section (even
Base64 encoded) or a C<public> directory if it exists.
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 will be served automatically from a C<public> directory
if it exists and are not limited to a single file extension.
$ mkdir public
$ mv something.js public/something.js
$ mv mojolicious.tar.gz public/mojolicious.tar.gz
=head2 Testing
Expand Down

0 comments on commit 70080e1

Please sign in to comment.