title: Angular API call is not hitting in controller method
body: <p>I am not able to hit my controller method Get</p>
  <p>I have <strong>register.component.ts</strong> file in this i am calling dataservice's getfeed method</p>
  <pre><code>ngOnInit() {
  this.dataservice.getFeed('register').subscribe(result =&gt; {
  }
  </code></pre>
  <p>in the <strong>data.service.ts</strong> file, i have written like</p>
  <pre><code>@Injectable()
  export class DataService {
  constructor(private http: HttpClient) { }
  
  getFeed(methodName: string): Observable&lt;any&gt; {
  
  return this.http.get(environment.baseApiUrl + methodName);
  }
  }
  </code></pre>
  <p>In My <strong>environment.ts</strong> file i have</p>
  <pre><code> baseApiUrl:'http://localhost:4200/api/'
  </code></pre>
  <p>And finally in <strong>RegisterController.cs</strong> i coded like</p>
  <pre><code>[ApiController]
  [Route(&quot;[controller]&quot;)]
  public class RegisterController : ControllerBase
  {
      [HttpGet]
      [ProducesResponseType(400)]
      [ProducesResponseType(typeof(string), 500)]
      public async Task&lt;IActionResult&gt; Get()
      {
      }
  }
  </code></pre>
  <p>But this Get is not hitting no way. I tried different URL directly from browser. But nothing is hitting in that get method. Any idea what i am missing in my implementation?</p>
  <p>And in my <strong>Startup.cs</strong> file i have something like this</p>
  <pre><code>    public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
      {
          if (env.IsDevelopment())
          {
              app.UseDeveloperExceptionPage();
          }
  
          app.UseHttpsRedirection();
          app.UseStaticFiles();
  
          app.UseRouting();
  
          app.UseEndpoints(endpoints =&gt;
          {
              endpoints.MapControllerRoute(name: &quot;default&quot;, pattern: &quot;{controller}/{action=index}/{id?}&quot;);
          });
  </code></pre>