node -v
npm install -g create-react-app
create-react-app my-app
npm run build
spring.resources.static-locations=classpath:/META-INF/resources/,classpath:/resources/,classpath:/static/,classpath:/public/
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
public class ReactController {
@RequestMapping(value = "/", produces = "text/html")
public String index() {
return "index";
}
}
<dependency>
<groupId>org.webjars</groupId>
<artifactId>react</artifactId>
<version>{react-version}</version>
</dependency>
groovy
implementation 'org.webjars:react:{react-version}'