title: I am getting a 404 Error on API Call in Spring Boot
body: <p>I am working on a Spring Boot Application. I am getting a <strong>404 error</strong> on hitting the URL-path which I have configured. Where am I going wrong? </p>
  
  <p><strong>HomeController.java</strong> </p>
  
  <pre><code>package com.example.homes;
  
  import org.springframework.web.bind.annotation.GetMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController("/add")
  public class HomeController {
  
      @GetMapping("/hello")
      public String add() {
          return "Hello";
      }
  
  }
  </code></pre>
  
  <p><strong>HomeApplication.java</strong> </p>
  
  <pre><code>package com.example.homes;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RestController;
  
  @SpringBootApplication
  public class HomeApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(HomeApplication.class, args);
          System.out.println("Inside main");
      }
  
  }
  </code></pre>