title: Fastapi returns 404 when accessing URL in the browser
body: <p>I am learning <code>fastapi</code> and created the sample following application</p>
  <pre><code>from fastapi import FastAPI
  import uvicorn
  app = FastAPI()
  
  @app.get(&quot;/hello&quot;)
  async def hello_world():
     return {&quot;message&quot;: &quot;hello_world&quot;}
  
  if __name__== &quot;__main__&quot;:
     uvicorn.run(app, host=&quot;127.0.0.1&quot;, port=8080)
  </code></pre>
  <p>The server starts fine but when I test the <code>url</code> in browser I am getting the following error:</p>
  <pre><code>{&quot;detail&quot;: &quot;Not Found&quot;}
  </code></pre>
  <p>and this error in the log:</p>
  <pre><code>&quot;GET / HTTP /&quot; 404 Not Found
  </code></pre>
  <p>I noticed another weird problem, when I make some error its not detecting the error and still starting the server. For example if I change the function like the following</p>
  <pre><code>@app.get(&quot;/hello&quot;)
  async def hello_world():
     print (sample)
     return {&quot;message&quot;: &quot;hello_world&quot;}
  </code></pre>
  <p>It should have thrown the error <code>NameError: &quot;sample&quot; not defined</code> but it still is starting the server. Any suggestions will be helpful</p>