I'm trying to create à Rest controller that listen on "/login" I have defined the code bellow but when I open http://localhost:8080/login I get a 404 error... Please help :)
Here is my package structure:
com.my.package
|_ Application.java
|_ controller
|_ LoginController
My Application:
@ComponentScan("com.my.package.controller")
@SpringBootApplication
public class Application {
public static void main(String[] args){
SpringApplication.run(Application.class, args);
}
}
My Rest controller:
@RestController
public class LoginController {
@RequestMapping("/login")
public @ResponseBody String getLogin(){
return "{}";
}
}