https://github.com/dylanblokhuis/country-city-api
Easy web service to fetch all countries including cities
https://github.com/dylanblokhuis/country-city-api
cities country-city-api docker microservice nodejs unece
Last synced: 2 months ago
JSON representation
Easy web service to fetch all countries including cities
- Host: GitHub
- URL: https://github.com/dylanblokhuis/country-city-api
- Owner: dylanblokhuis
- License: mit
- Created: 2020-11-09T16:10:41.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-09T18:52:46.000Z (over 4 years ago)
- Last Synced: 2025-01-11T17:53:31.431Z (4 months ago)
- Topics: cities, country-city-api, docker, microservice, nodejs, unece
- Language: TypeScript
- Homepage:
- Size: 18.6 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Country City API
Simple node.js microservice that provides up-to-date country and city names from [United Nations Economic Commission for Europe](https://unece.org)
## Quick start
```npm install```
```npm run start```
## Quick start with Docker
Pull latest image from registry
```docker pull dylanblokhuis/country-city-api```Start the container
```docker run -d -p 3000:3000 dylanblokhuis/country-city-api```Open [localhost:3000](http://localhost:3000) to see if it's working.
## Routes
```/countries```
Response
```
[
...
{
"countryCode": "NL",
"url": "https://service.unece.org/trade/locode/nl.htm",
"name": "Netherlands"
},
{
"countryCode": "NC",
"url": "https://service.unece.org/trade/locode/nc.htm",
"name": "New Caledonia"
},
{
"countryCode": "NZ",
"url": "https://service.unece.org/trade/locode/nz.htm",
"name": "New Zealand"
},
...
]
```
```/countries/:countryCode```
Example: ```/countries/NL```
Response
```
[
"Aa en Hunze",
"Aalburg",
"Aalsmeer",
"Aalsmeerderbrug",
"Aalst",
"Aalten",
"Aan de Zuwe",
"Aardenburg",
"Aarlanderveen",
"Aarle Rixtel",
"Abbegaasterketting",
"Abbekerk",
"Abbenbroek",
...
]
```