Use non-testing API key

If you care enough to read this git commit message, rest assured that I
am aware that this is a terrible solution. However, no good solution
currently exists for saving an API key in a simple statically served web
page. I did this to prevent automatic crawling from detecting my API
keys, any interested user can easily btoa this. However, _no solution_
here is possible: at the end of the day I have to send an API request to
ANU and I have to pass this header.

I don't want the headache of hosting a server-side webapp to do this
properly, I'll probably just pay €20 to ANU and see how far that gets
me.

This commit fixes #2.
main
Rens Oliemans 3 weeks ago
parent 9cbbbcf855
commit 87606d0c22
Signed by: rens
GPG Key ID: CD37836E088B896B
  1. 4
      src/main.js

@ -59,9 +59,11 @@ const getIntegersFromAPI = () => {
const getIntegerPromiseFromAPI = () => {
const url = buildUrl();
const headerValue = atob('UW9uVTB1NTQ2dTIyclNVOGRwdXRxM3ZZNlNmNW5DMWRyZnBwMVY5NQ==');
return fetch(url, {
headers: {
'x-api-key': 'FCocrjguIx3txJoU9FcY73UcGodsyOrlax84bDtG'
'x-api-key': headerValue
}
});
};

Loading…
Cancel
Save