<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/content/migration.md - fork/static-web-server @ allow-symlink</title>
<meta name="description" content="docs/content/migration.md in fork/static-web-server at allow-symlink.">
<meta property="og:title" content="docs/content/migration.md - fork/static-web-server @ allow-symlink">
<meta property="og:description" content="docs/content/migration.md in fork/static-web-server at allow-symlink.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="allow-symlink" data-tip="4414610fe1b0370ff0ac415e9367548840584710">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/static-web-server</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/static-web-server</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Matthias Schoettle</span><span class="commit-message" data-commit="dd43d06551fcf853e0012381c76af5b832d23b57">refactor: format check support Markdown files via mdformat (#597)</span><span class="snapshot-sha sha" data-commit="dd43d06551fcf853e0012381c76af5b832d23b57">dd43d06</span><time datetime="2025-12-07T04:40:21-05:00" title="2025-12-07 04:40:21 -0500">2025-12-07</time></p>
<header class="topbar"><details class="switcher"><summary>allow-symlink</summary><div class="menu"><strong>branches</strong><a class="current" href="/fork/static-web-server/ref/allow-symlink/">allow-symlink</a><a class="all" href="/fork/static-web-server/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/static-web-server/">static-web-server</a> / <a href="/fork/static-web-server/ref/allow-symlink/tree/docs/">docs</a> / <a href="/fork/static-web-server/ref/allow-symlink/tree/docs/content/">content</a> / <span class="cur">migration.md</span></nav>
<span class="view-stats"><span>2.1 KiB</span><span>25 lines</span></span><span class="actions"><a class="raw" href="/fork/static-web-server/raw/61be84e5fabba1e530e17172ab31235c5c88111f/docs/content/migration.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1>Migrating from v1 to v2</h1>
<p>The <code>v2</code> introduces notable changes including new features, performance improvements and new target support like ARM64 and OSes like FreeBSD, NetBSD, Illumos or Android.</p>
<p>This version <code>v2</code> was re-written almost from scratch on top of <a href="https://github.com/hyperium/hyper">Hyper</a> and <a href="https://github.com/tokio-rs/tokio">Tokio</a> runtime which gives us the <a href="https://rust-lang.github.io/async-book/01_getting_started/02_why_async.html">Rust asynchronous ability</a> by default and the latest HTTP/1 - HTTP/2 implementation improvements.
However, it still tries to keep the same principles of its <code>v1</code>: lightness and easy-to-use. Therefore migration should not be a big deal.</p>
<h2>v2 breaking changes</h2>
<p>This major <code>v2</code> has a few breaking changes. However, migration should not represent a problem.</p>
<p>!!! tip "Tip"</p>
<pre><code>It is always worth recommending that you test a major server version upgrade like this first with your application(s) in a development environment or similar.
</code></pre>
<p>Please keep in mind the following changes in <code>v2</code>:</p>
<ul>
<li>The server now supports only a root directory path (via <code>--root</code> or its equivalent env) so an assets path option is no longer required.</li>
<li>Cache-control headers are arbitrarily applied to assets. See <a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/features/cache-control-headers.md">control headers examples</a> for more details.</li>
<li>OpenSSL TLS for HTTP/1 is no longer supported, instead for the HTTP/2 &amp; TLS (via <code>--http2</code> option) the server uses <a href="https://github.com/hyperium/h2">h2</a> which is on top of <a href="https://github.com/ctz/rustls">Rustls</a>. It means that instead of using a <code>.p12</code> or <code>.pfx</code> file you can now use only a certificate file along with its private key. See <a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/features/http2-tls.md">HTTP/2 &amp; TLS examples</a> for more details.</li>
<li>If using HTTP to HTTPS redirect, then check out <a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/features/http-https-redirect.md">the new feature page</a> to adjust the options accordingly.</li>
</ul>
<p>The rest of the known options are equivalent to <code>v1</code> (except the new ones of course).</p>
<p>For feedback or questions feel free to reach us on <a href="https://github.com/static-web-server/static-web-server/discussions">the discussions page</a>.</p>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>Migrating from v1 to v2</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">The `v2` introduces notable changes including new features, performance improvements and new target support like ARM64 and OSes like FreeBSD, NetBSD, Illumos or Android.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">This version `v2` was re-written almost from scratch on top of [Hyper](https://github.com/hyperium/hyper) and [Tokio](https://github.com/tokio-rs/tokio) runtime which gives us the [Rust asynchronous ability](https://rust-lang.github.io/async-book/01_getting_started/02_why_async.html) by default and the latest HTTP/1 - HTTP/2 implementation improvements.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text">However, it still tries to keep the same principles of its `v1`: lightness and easy-to-use. Therefore migration should not be a big deal.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text"><a-p>##</a-p> <a-tt>v2 breaking changes</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text">This major `v2` has a few breaking changes. However, migration should not represent a problem.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text">!!! tip &quot;Tip&quot;</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-tl>    It is always worth recommending that you test a major server version upgrade like this first with your application(s) in a development environment or similar.</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text">Please keep in mind the following changes in `v2`:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>- </a-p>The server now supports only a root directory path (via `--root` or its equivalent env) so an assets path option is no longer required.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>- </a-p>Cache-control headers are arbitrarily applied to assets. See [control headers examples](./features/cache-control-headers.md) for more details.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>- </a-p>OpenSSL TLS for HTTP/1 is no longer supported, instead for the HTTP/2 &amp; TLS (via `--http2` option) the server uses [h2](https://github.com/hyperium/h2) which is on top of [Rustls](https://github.com/ctz/rustls). It means that instead of using a `.p12` or `.pfx` file you can now use only a certificate file along with its private key. See [HTTP/2 &amp; TLS examples](./features/http2-tls.md) for more details.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>- </a-p>If using HTTP to HTTPS redirect, then check out [the new feature page](./features/http-https-redirect.md) to adjust the options accordingly.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text">The rest of the known options are equivalent to `v1` (except the new ones of course).</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text">For feedback or questions feel free to reach us on [the discussions page](https://github.com/static-web-server/static-web-server/discussions).</span></span></pre></div></div>
</main>
</body>
</html>
