title: MVC Routing in .NET Core React project isn't picking up my Controller
body: <p>I am learning how to create React applications with ASP.NET Core. As a newbie I am starting at the very beginning and trying to get "Hello World" displayed on the home page. I have used Visual Studio's default React.js project template to get me started. The routes are set to default. Here are my files: </p>
  
  <p>Home.js:</p>
  
  <pre><code>import React, { Component } from 'react';
  
  export class Home extends Component {
  
      constructor(props) {
          super(props);
          this.state = { message: "" };
  
          fetch('api/Home/Message')
            .then(response =&gt; response.json())
            .then(data =&gt; {
            this.setState({ message: data });
          });
  
      }
  
    render () {
        return (
  
              &lt;h1&gt;{this.state.message}&lt;/h1&gt;
  
      );
    }
  }
  </code></pre>
  
  <p>HomeController.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Threading.Tasks;
  using Microsoft.AspNetCore.Mvc;
  
  
  namespace TestingReactDotNet.Controllers
  {
  [Route("api/[controller]")]   
  public class HomeController :  Controller
      {
          [HttpGet]
          public async Task&lt;IActionResult&gt; Message()
          {
              var response = "Hello World";
              return Ok(response);
          }
      }
  }
  
  </code></pre>
  
  <p>The problem is that the HTTP response that is being parsed to Json isn't the correct one. I have console.logged it out in order to try to debug, and it appears that <code>response.json())</code> is retrieving all of the text in the default <code>public/index.html</code> file that comes with the template application. Does anyone have any idea why this is? </p>
  
  <p>Apologies if I am missing something super obvious - I use a Mac, so the file structure and Visual Studio IDE are quite different and I have struggled to understand quite a few of the tutorials/answers already out there.</p>