It was Saturday night. I had a lot of time on my hands so I decided to browse Reddit.
Reddit has so many links, clicking on each link manually was a burden to my hands and wasn’t time efficient.
I decided to automate opening each link.
The problem is that GoodReads API did not enable Cross-origin resource sharing (CORS) headers thus AjAX calls were failing.
How can we get around the issue?
You are writing code either professionally or for fun. A lot of times, we think that our code will never change.
But then we run into many situations where that’s not the case.
What would help you to mitigate these issues?
Suppose that you were working on merging client data with a Microsoft Word template and everything went well. And then boom, a week later, you are notified from a user that there was an issue with the generated Word file.
The template file contains a signature field, in which you merge a client’s names. The issue is that some clients’ names are so long, the signature field overflows into next line. This causes the rest of documents to create another page, thus wasting the formatting of the document as well as a paper unnecessarily.
If you are a Front-end/Web developer, you will understand the solution that I came up with.