-1

I want to build an app that should show updated corona cases worldwide. One of the instructions says that the data should be queried from a public accessible REST API. What exactly is meant by this and is it possible to achieve this with angular?

Thank you!

Meenakshi
  • 31
  • 1
  • 7

1 Answers1

0

An API is an interface to communicate with,usually we saw that in the server with the form of endpoind (I'm talking about REST), the server will be connect to a database where you have ... data.

YOur objectiv is to get data about corona so your front angular will have to get data, since you cannot directly interact with database that's not your's will ask an API some data -> in tech you will make a request on an endpoint like (https://thismyurl/allcovidvalue) <- (fake url) and a serveur will respond.

You have to find an api that have data about corona and a public API (free to use so)

To do it in angular I recommand to use HttpClient

Thibaud
  • 1,059
  • 4
  • 14
  • 27
  • thank you for your answer. That means, the angular app should connect with some REST API with data via HttpClient, right? If I may ask, where can I find such API which wold provide this data? – Meenakshi Aug 04 '21 at 08:05
  • you can see that as a connection but again it's a request, your front will just send a message (it can be empty) to an adress (endpoint / url) and this adress will answeer something -> beware some API ask for an auth system so you will have to create an account and send token or specific data but it really depend of the API, public API may not ask that to find what you want I recommand you to search COVID API on google you will find a lot of result -> you are searching for something with an url and they will show you an exemple of response (JSON in most of the cases) – Thibaud Aug 04 '21 at 08:10
  • @Meenakshi you can use this ulr to get data from FRANCE https://covidapi.info/api/v1/country/FRA you can replace FRA by id of the country you want ;) (just click on this link in the browser it will show you the result you may want) learn more on https://documenter.getpostman.com/view/2568274/SzS8rjbe?version=latest#b23d47ff-a3b9-47e0-9f6e-67bdebc3bf0f – Thibaud Aug 04 '21 at 08:16
  • 1
    thanks a lot. I will start working on this and might come back to you with more questions later. Thank you very much again. – Meenakshi Aug 04 '21 at 08:28