Sha256: f48ec125290d46e06869fd582cc298ce66364958a9c3fe72f706498da367807d

Contents?: true

Size: 1.71 KB

Versions: 31

Compression:

Stored size: 1.71 KB

Contents

<!DOCTYPE html>
<html>
	<head>
		
			<title>Static - Utopia</title>
		
		<meta charset="UTF-8"/>
		
		<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" integrity="sha384-wvfXpqpZZVQGK6TAh5PVlGOfQNHSoD2xbE+QkPxCAFlNEevoEH3Sl0sibVcOQVnN" crossorigin="anonymous"/>
		
		<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="">
		<header>
			<img src="../../../_static/utopia.svg"/>
		</header>

		<div id="page">
			
	<nav>
	 › <a href="../../../wiki.html">Wiki</a> › <span>Middleware</span> › <a href="../static.html">Static</a></nav>

	
	<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>

	
	<footer>
		Last Modified: 2016-12-13 12:36:48 +1300 —
	</footer>

		</div>
	</body>
</html>

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
utopia-2.13.4 docs/wiki/middleware/static/index.html
utopia-2.13.3 docs/wiki/middleware/static/index.html
utopia-2.13.2 docs/wiki/middleware/static/index.html
utopia-2.13.1 docs/wiki/middleware/static/index.html
utopia-2.13.0 docs/wiki/middleware/static/index.html
utopia-2.12.4 docs/wiki/middleware/static/index.html
utopia-2.12.3 docs/wiki/middleware/static/index.html
utopia-2.12.2 docs/wiki/middleware/static/index.html
utopia-2.12.1 docs/wiki/middleware/static/index.html
utopia-2.12.0 docs/wiki/middleware/static/index.html
utopia-2.11.1 docs/wiki/middleware/static/index.html
utopia-2.11.0 docs/wiki/middleware/static/index.html
utopia-2.10.0 docs/wiki/middleware/static/index.html
utopia-2.9.5 docs/wiki/middleware/static/index.html
utopia-2.9.3 docs/wiki/middleware/static/index.html
utopia-2.9.2 docs/wiki/middleware/static/index.html
utopia-2.9.1 docs/wiki/middleware/static/index.html
utopia-2.9.0 docs/wiki/middleware/static/index.html
utopia-2.8.2 docs/wiki/middleware/static/index.html
utopia-2.8.1 docs/wiki/middleware/static/index.html