title: How to correctly connect swagger definition to a subfolder of the deployed app to the hosting
body: <p>I have a .net core web api application with swagger.</p>
  <p>I'm using .net 5</p>
  <p><strong>Infrastructure:</strong></p>
  <p>I'm using smarterasp hosting services for react app and webapi app.
  React app is on the root of the created (folder) website.
  I just moved my webapi from my root folder to the folder <code>api</code>.</p>
  <p><em>Note:</em> the webapi worked ok, when it was initially in the root folder.</p>
  <p><strong>Problem:</strong></p>
  <p>As I mentioned, when I moved my webapi to the <code>api</code> subfolder, I'm getting the error:</p>
  <p><a href="https://i.stack.imgur.com/6lUEq.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6lUEq.png" alt="Screenshot" /></a></p>
  <p><strong>Attempts:</strong></p>
  <p>I tried to change address in my Startup.cs class:</p>
  <ul>
  <li>./swagger/v1/swagger.json</li>
  <li>api/swagger/v1/swagger.json</li>
  </ul>
  <pre><code>public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IConfiguration configuration)
  {
          app.UseDeveloperExceptionPage();
          app.UseSwagger();
          app.UseSwaggerUI(c =&gt;
          {
              c.SwaggerEndpoint(&quot;./swagger/v1/swagger.json&quot;, &quot;NNN.WebApi v1&quot;);
              c.RoutePrefix = string.Empty;
          });
         ...
  }
  </code></pre>
  <p>but, I'm getting or this failure message or 404 not found..</p>