title: This localhost page can’t be found, possible configuration problem
body: <p>Whatever page I try to load after running my api, I get the "This localhost page can’t be found" 404 error, even if I try to run a method that only has an "Ok" return.
  I'm thinking the issue might lie in the way I configured my app. That, or I made some errors while routing.</p>
  
  <p>I've tried messing around with app configuration, looking at examples, but most of them have additional NuGet packages installed. I tried using the <code>.AddControllers()</code> method in the <code>ConfigureServices</code> method, which resulted in a syntax error, I tried using <code>.UseRouting()</code> in my <code>Configure</code> function, and again, I was met with a syntax error. </p>
  
  <p>Startup class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void ConfigureServices(IServiceCollection services)
          {
              services.AddScoped&lt;IRepositoryWrapper, RepositoryWrapper&gt;();
              services.AddDbContext&lt;ArtGalleriesContext&gt;(
                  options=&gt;options.UseSqlServer(
                      Configuration.GetConnectionString("Database")));
              //services.AddScoped&lt;IArtItemRepository1, ArtItemRepository1&gt;();
              services.AddMvc();
              services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_2);
          }
  
          // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
          public void Configure(IApplicationBuilder app, IHostingEnvironment env)
          {
              if (env.IsDevelopment())
              {
                  app.UseDeveloperExceptionPage();
              }
              else
              {
                  // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
                  app.UseHsts();
              }
  
              app.UseHttpsRedirection();
              app.UseMvc(routes =&gt;
              {
                  routes.MapRoute(
                      name: "default",
                      template: "{controller=Home}/{action=Index}/{id?}");
              });
  </code></pre>
  
  <p>Program class:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public static void Main(string[] args)
          {
              CreateWebHostBuilder(args).Build().Run();
          }
  
          public static IWebHostBuilder CreateWebHostBuilder(string[] args) =&gt;
              WebHost.CreateDefaultBuilder(args)
                  .UseStartup&lt;Startup&gt;();
  </code></pre>
  
  <p>I am trying to call this function</p>
  
  <pre><code> [Route("api/[controller]")]
      [ApiController]
      public class AdminController : ControllerBase
   [HttpGet("/user/add/{num1}/")]
          public IActionResult SumActionResult(int num1)
          {
              return Ok(num1 );
          }
  </code></pre>
  
  <p>like this: api/admin/users/add/1 and have it display 1 in my web page to confirm functionality. 
  I am getting the "This localhost page can't be found" error instead.</p>