<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/content/features/http1.md - fork/static-web-server @ allow-symlink</title>
<meta name="description" content="docs/content/features/http1.md in fork/static-web-server at allow-symlink.">
<meta property="og:title" content="docs/content/features/http1.md - fork/static-web-server @ allow-symlink">
<meta property="og:description" content="docs/content/features/http1.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> / <a href="/fork/static-web-server/ref/allow-symlink/tree/docs/content/features/">features</a> / <span class="cur">http1.md</span></nav>
<span class="view-stats"><span>1.0 KiB</span><span>17 lines</span></span><span class="actions"><a class="raw" href="/fork/static-web-server/raw/7b4f80424e012631d64c0bc548a7ba8fee9fd356/docs/content/features/http1.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>HTTP/1</h1>
<p>The HTTP/1 is the protocol by default and can be used by specifying a host address via the <code>-a, --host</code> (<a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/configuration/environment-variables.md#server_host">SERVER_HOST</a>) argument, the port of the host via <code>-p, --port</code> (<a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/configuration/environment-variables.md#server_port">SERVER_PORT</a>) and the directory of the static files using the <code>-d, --root</code> (<a href="/fork/static-web-server/ref/allow-symlink/blob/docs/content/configuration/environment-variables.md#server_root">SERVER_ROOT</a>) argument.</p>
<p>!!! info "Tips"</p>
<pre><code>- Either `--host`, `--port` and `--root` have defaults (optional values) so they can be specified or omitted as required.
- The server provides [Termination Signal](https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html) handling with [Graceful Shutdown](https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace) ability by default.
</code></pre>
<p>Below is an example of how to run the server using HTTP/1.</p>
<pre class="language-bash"><a-f>static-web-server</a-f> \
    <a-co>--host</a-co> 127.0.0.1 \
    <a-co>--port</a-co> 8787 \
    <a-co>--root</a-co> ./my-public-dir</pre>
</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>HTTP/1</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 HTTP/1 is the protocol by default and can be used by specifying a host address via the `-a, --host` ([SERVER_HOST](./../configuration/environment-variables.md#server_host)) argument, the port of the host via `-p, --port` ([SERVER_PORT](./../configuration/environment-variables.md#server_port)) and the directory of the static files using the `-d, --root` ([SERVER_ROOT](./../configuration/environment-variables.md#server_root)) argument.</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">!!! info &quot;Tips&quot;</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text"><a-tl>    - Either `--host`, `--port` and `--root` have defaults (optional values) so they can be specified or omitted as required.</a-tl></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-tl>- The server provides [Termination Signal](https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html) handling with [Graceful Shutdown](https://cloud.google.com/blog/products/containers-kubernetes/kubernetes-best-practices-terminating-with-grace) ability by default.</a-tl></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">Below is an example of how to run the server using HTTP/1.</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"><a-p>```</a-p><a-tl>sh</a-tl></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>static-web-server \</a-p></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-p>    --host 127.0.0.1 \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>    --port 8787 \</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>    --root ./my-public-dir</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>```</a-p></span></span></pre></div></div>
</main>
</body>
</html>
