title: How to assign a function to a route functionally, without a route decorator in FastAPI?
body: <p>In Flask, it is possible to assign an arbitrary function to a route functionally like:</p>
  <pre class="lang-py prettyprint-override"><code>from flask import Flask
  app = Flask()
  
  def say_hello():
      return &quot;Hello&quot;
  
  app.add_url_rule('/hello', 'say_hello', say_hello)
  </code></pre>
  <p>which is equal to (with decorators):</p>
  <pre class="lang-py prettyprint-override"><code>@app.route(&quot;/hello&quot;)
  def say_hello():
      return &quot;Hello&quot;
  </code></pre>
  <p>Is there such a simple and functional way (<code>add_url_rule</code>) in FastAPI?</p>