Я новичок в Spring-Boot, и я тестирую Spring-Boot приложение, используя http API, но я получил ошибку соединения.
GET http://localhost: 8080 / api / helloworld
org. apache .http.conn.HttpHostConnectException: подключение к локальному узлу: 8080 [localhost / 127.0.0.1] не удалось: соединение отклонено: подключиться
//HelloWorldController.java
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
@RestController
public class HelloWorldController {
@GetMapping(value="/api/helloworld")
public String helloWorld(){
return "helloworld";
}
}
//helloworld.http
GET http://localhost:8080/api/helloworld
И он хорошо работает с запуском основного java файла.

Пожалуйста, дайте мне знать, где я делаю неправильно. Спасибо.