I have my Java server setup with all the appropriate packages (API, DAO, model, service, etc.). On the Hacker News (HN) website they explain that I should use Firebase to call their API.
Do I need to configure Firebase to access all the HN articles from the API, even though I have access to Java's built-in API call functionalities?
I can retrieve one article and see the JSON data in Postman:
URL getUrl = new URL("https://hacker-news.firebaseio.com/v0/item/29042728.json?print=pretty");
print = pretty
HttpURLConnection connection = (HttpURLConnection) getUrl.openConnection();
// If a connection (200 OK) is made, data is buffered
BufferedReader art = new BufferedReader(new
InputStreamReader(connection.getInputStream()));
StringBuffer jsonResponseData = new StringBuffer();
String readLine = null;
// Appends data from the response line by line
while ((readLine = art.readLine()) != null) {
jsonResponseData.append(readLine);
}
in.close();
Is Firebase still needed for something else?
Reference: Hacker News API