java – Spring Boot Kotlin API returns 404 response for all endpoints
java – Spring Boot Kotlin API returns 404 response for all endpoints
I guess your CricketerController
is not in a subpackage relative to your main class. So you basically have two options:
- Place your main class directly under the package com.example
- Add the annotation at the bottom of this answer to your main class.
Using any of these two methods makes the controller class visible for Spring at startup and therefore should create your mappings.
@ComponentScan(basePackages = { com.example.controller} )