- Published on
Creating CountryFlagsAPI.com
- Authors
- Name
- Jeremy Persing
Introduction
I created countryflagsapi.com because I was working on a project that needed the flags for various different countries. The API that we were using at the time went offline, so we had to download the 250+ country flags and incorporate them into our app. Now this wasn't so bad, but one problem that we faced was that the files were downloaded in ISO Alpha-2 format (ex: us.png), while our data was giving us a butchered version of ISO Alpha-3 codes to identify countries. This led to having to the time intensive task of translating each code from the butchered ISO Alpha-3 to ISO Alpha-2 using a hashmap. I fidn't want anyone else to have to go thrugh this tedious process so that is why countryflagsapi.com was created.
Architecture & Deployment
I used Express to created the backend for the app, and am just serving static html files for the frontend. Being that there are only 254 countries, I'm not using any database for the API, so everything is stored locally. The backend is deployed on Heroku free tier right now and I'm using Cloudflare's free SSL certificate. I'm also using Cloudflare to manage the DNS.