🦠A simple and fast (< 200ms) API for tracking the global coronavirus (COVID-19, SARS-CoV-2) outbreak. It's written in python using the 🔥 FastAPI framework. Supports multiple sources!
I applied a singleton pattern.
The reason I chose singleton is because location/init.py makes use of both utils/countries.py and utils/population.py. I combined the two in one class and created a single instance and this instance is shared to all clients.
How I did it:
I added a singleton pattern in utils/countries_population.py
I applied a singleton pattern. The reason I chose singleton is because location/init.py makes use of both utils/countries.py and utils/population.py. I combined the two in one class and created a single instance and this instance is shared to all clients. How I did it: I added a singleton pattern in utils/countries_population.py