Sha256: 49430dd6bb74282e198032ab4712b12af9a137ebe99ba160c66c5eb73dd94be0
Contents?: true
Size: 1.42 KB
Versions: 3
Compression:
Stored size: 1.42 KB
Contents
<!DOCTYPE html> <html> <head> <title>Static</title> <meta charset="UTF-8"/> <link rel="icon" type="image/png" href="../../_static/icon.png"/> <link rel="stylesheet" href="../../_static/site.css" type="text/css" media="screen"/> <script src="../../_components/jquery/jquery.min.js"></script> <script src="../../_components/jquery-syntax/jquery.syntax.min.js"></script> <script type="text/javascript"> //<![CDATA[ jQuery(function($) { $.syntax(); }); //]]> </script> </head> <body class="show"> <nav> › <a href="../../index.html">Wiki</a> › <span>Middleware</span> › <a href="index.html">Static</a></nav> <main> <h1 id="static">Static</h1> <p>This middleware serves static files using the <code>mime-types</code> library. By default, it works with <code>Rack::Sendfile</code> and supports <code>ETag</code> based caching. Normally, you’d prefer to put static files into <code>public/_static</code> but it’s also acceptable to put static content into <code>pages/</code> if it makes sense.</p> <pre><code class="language-ruby">use Utopia::Static, # The root path to serve files from: root: "path/to/root", # The mime-types to recognize/serve: types: [:default, :xiph], # Cache-Control header for files: cache_control: 'public, max-age=7200' </code></pre> </main> <footer> Last Modified: 2020-04-28 11:35:36 +1200 — middleware/static/index.md </footer> </body> </html>
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
utopia-2.15.1 | docs/middleware/static/index.html |
utopia-2.15.0 | docs/middleware/static/index.html |
utopia-2.14.0 | docs/middleware/static/index.html |