Web service to get lat/lng based on ISO country and postal code.
You know…because it has to do with postal codes and it’s written in Express.
- Clone repository
- unzip ./resources/allCountries.txt.zip to ./resources/allCountries.txt
- npm start
Performance / Scalability
Running This as an Express App
This proof-of-concept performs remarkably un-shittyful for being a data structure fed by a 69MB text file.
Like, freaky fast. If you’re going to want to add any conditional logic or intellegence then you’re going
to obviously want to use Express. Maybe you’ll want to customize the data store.
If you put this behind Varnish there’d be no stopping you.
You would crush your enemies, see them driven before you, and hear the lamentation of their women.
Exporting Static Files
If all you need is lat lng…it seems easy enough to write a script that would generate static files
in a directory structure that would look like the endpoints. I could imagine serving static files with nginx being
the fastest, most stable, and least-engineered way of running your own lat/lng service.
This data is from Geonames Postal Code Database
Master HEAD currently uses the verison created 2017-07-23 09:48
Send me a PR is it gets out of date.