title: How to define the base url for the asp.net core app
body: <p>I have one ASP.NET Core 3.1.0 web app and I am struggling to understand the url exposed by asp.net core.</p>
  <p>I have one single controller</p>
  <pre><code>[Route(&quot;accounts&quot;)]
  public class AccountsController : BaseController
  {
      public AccountsController()
      {
      }
  
      [HttpGet(&quot;{test}&quot;)]
      public string DefaultMethod()
      {
          return &quot;Hello&quot;;
      }
  }        
  </code></pre>
  <p>In my Startup.cs, I am using UsePathBase as</p>
  <pre><code>app.UsePathBase(&quot;/account-api&quot;);
  </code></pre>
  <p>When I start the app, I can access the method as</p>
  <p>http://localhost:5000/account-api/accounts/test and it is fine</p>
  <p>But I can also access it via http://localhost:5000/accounts/test which I want to restrict.</p>
  <p>How can I restrict this?</p>