https://github.com/oultimocoder/cloudflare-country-codes-api
A simple Cloudflare Workers API utilising Hono to return country information such as country code, emoji flag, languages etc based on the request ip address
https://github.com/oultimocoder/cloudflare-country-codes-api
api cloudflare cloudflare-workers country country-codes country-flags country-list hono typescript
Last synced: 11 months ago
JSON representation
A simple Cloudflare Workers API utilising Hono to return country information such as country code, emoji flag, languages etc based on the request ip address
- Host: GitHub
- URL: https://github.com/oultimocoder/cloudflare-country-codes-api
- Owner: OultimoCoder
- License: mit
- Created: 2023-07-27T08:56:11.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-07-27T11:44:50.000Z (over 2 years ago)
- Last Synced: 2025-02-06T06:30:00.488Z (about 1 year ago)
- Topics: api, cloudflare, cloudflare-workers, country, country-codes, country-flags, country-list, hono, typescript
- Language: TypeScript
- Homepage:
- Size: 200 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Cloudflare Country Codes API
A simple API that uses the `CF-IPCountry` header in a Cloudflare worker to determine the requests
country and then return a list of information about said country.
Uses [Cloudflare Workers](https://workers.cloudflare.com/) and [Hono](https://honojs.dev/).
[Try Me!](https://api.countryin.fo/me?pretty)
## Commands
Running locally:
```bash
npm run dev
```
Testing:
```bash
# run all tests
npm run tests
# run test coverage
npm run tests:coverage
# run test coverage summary
npm run tests:summary
```
Linting:
```bash
# run ESLint
npm run lint
# fix ESLint errors
npm run lint:fix
# run prettier
npm run prettier
# fix prettier errors
npm run prettier:fix
```
Deploy to Cloudflare:
```bash
npm run deploy:dev
npm run deploy:prod
```
## License
[MIT](LICENSE)