h as websockets:</p>
<pre><code class="language-js">const middle = ctx =&gt; {
  expect(ctx.data).toBe(&#39;Hello 世界&#39;);
};

// Test it (csrf set to false for testing purposes)
run(noCsrf, middle).post(&#39;/&#39;, { body: &#39;Hello 世界&#39; });
run(middle).emit(&#39;message&#39;, &#39;Hello 世界&#39;);
</code></pre>
<p>To handle forms sent normally:</p>
<pre><code class="language-pug">//- index.pug
form(method=&quot;POST&quot; action=&quot;/contact&quot;)
  input(name=&quot;email&quot;)
  inpu