"Page Not Found/404 handler” to Swift Express Server
<p>I’m writing the simplest server via <a href="https://github.com/crossroadlabs/Express" rel="nofollow">Swift Express</a></p>

<p>And I want to add custom handler for “url not found” so that if user write “/notFoundUrl” he will see something like that:   “Url “notFoundUrl” not found, please go to home page”.</p>

<p>I’ve added:</p>

<pre><code>app.get("/:notFoundUrl+") { (request:Request&lt;AnyContent&gt;)-&gt;Action&lt;AnyContent&gt; in
   print(request.params["notFoundUrl"])
   return Action&lt;AnyContent&gt;.render("index", context: ["hello": "Page Not Found: " + request.params["notFoundUrl"]!])
}
</code></pre>

<p>But it’s not appropriate becouse:</p>

<ul>
<li>Order does matter. </li>
<li>I can’t return 404 error.</li>
</ul>

<p>So how to add custom “Page Not Found/404 handler” to <a href="https://github.com/crossroadlabs/Express" rel="nofollow">Swift Express Server</a>?</p>