rki-covid-api
rki-covid-api copied to clipboard
rValue history of germany
this would fix #95
There are a few things i am not sure about:
- is the name
/germany/history/rValue
ok? - the first 4 days have a
r-value
ofnull
. Should we remove them? -
lastUpdate
is set tonow
. Is there a better way get thelastUpdate
value
1. is the name `/germany/history/rValue` ok? 2. the first 4 days have a `r-value` of `null`. Should we remove them? 3. `lastUpdate` is set to `now`. Is there a better way get the `lastUpdate` value
- think thats okay
- yes, that makes sense.
- maybe as in vaccination.ts
const response = await axios.get(
`https://www.rki.de/DE/Content/InfAZ/N/Neuartiges_Coronavirus/Daten/Impfquotenmonitoring.xlsx?__blob=publicationFile`,
{
responseType: "arraybuffer",
}
);
const data = response.data;
const lastModified = response.headers["last-modified"];
const lastUpdate = lastModified != null ? new Date(lastModified) : new Date();
that should work .....
if we would have:
const lastUpdate = history[history.length - 1].date;
then it would be in line with what we return in the function getRValue
.
Alternatively, we could also get it from the headers in getRValue
.
what is your take on this?
both should be the same and it is a good idea to take it from the header! My mind ....
/germany/history/rValue/:days
would be very nice!
/germany/history/rValue/:days
would be very nice!
I am already in the process :)
i am very sorry that it is not clear to me. but what should i change/add in README.md
?
God job! for me that looks all fine!
is replaced by new PR #494