title: How to change the default controller and action in ASP.NET Core API?
body: <p>I'm creating an ASP.NET Core API app, and currently, and when one creates a new project there is a controller named Values, and by default the API opens it when you run. So, I deleted that controller and added a new controller named Intro, and inside it an action named Get. In the <code>Startup.cs</code> file, I have the following lines of code:</p>
  
  <pre><code>app.UseMvc(opt =&gt;
  {
      opt.MapRoute("Default",
          "{controller=Intro}/{action=Get}/{id?}");
  });
  </code></pre>
  
  <p>And my Intro controller looks like this:</p>
  
  <pre><code>[Produces("application/json")]
  [Route("api/[controller]")]
  [EnableCors("MyCorsPolicy")]
  public class IntroController : Controller
  {
      private readonly ILogger&lt;IntroController&gt; _logger;
  
      public IntroController(ILogger&lt;IntroController&gt; logger)
      {
          _logger = logger;
      }
  
      [HttpGet]
      public IActionResult Get()
      {
          // Partially removed for brevity
      }
  }
  </code></pre>
  
  <p>But, again when I run the API, it by default tries to navigate to <code>/api/values</code>, but since I deleted the Values controller, now I get a 404 not found error. If I manually then navigate to <code>/api/intro</code>, I get the result that is provided from my Get action inside the Intro controller. How can I make sure that when the API run (for example through Debug->Start Without Debugging) that it by default gets the Get action from the Intro controller?</p>