我正在与 jhipster 合作并创建了一个测试控制器来查看我的应用程序是否正常工作
您可以在下面看到我的控制器:
@RestController
@Configuration
public class TestController {
private static final Logger log = LoggerFactory.getLogger(TestController.class);
@GetMapping("/test/github")
public String testEndpoint() {
log.info("Test endpoint called");
return "Test endpoint response";
}
}
在我的 SecurityConfiguration 文件中,我添加了以下行:
.requestMatchers(mvc.pattern("/test/github")).permitAll()
当我访问 http://localhost:8080/test/github 时,我会立即重定向到 http://localhost:8080/not-found 页面
不知道我错过了什么!