# geoapi - IP주소로 위치정보를 가져오는 가벼운 API서비스

> Clean Markdown view of GeekNews topic #1170. Use the original source for factual precision when an external source URL is present.

## Metadata

- GeekNews HTML: [https://news.hada.io/topic?id=1170](https://news.hada.io/topic?id=1170)
- GeekNews Markdown: [https://news.hada.io/topic/1170.md](https://news.hada.io/topic/1170.md)
- Type: news
- Author: [xguru](https://news.hada.io/@xguru)
- Published: 2019-12-30T16:02:40+09:00
- Updated: 2019-12-30T16:02:40+09:00
- Original source: [github.com](https://github.com/Risk3sixty-Labs/geoapi)
- Points: 5
- Comments: 2

## Topic Body

NodeJS용 geoip-lite모듈 (MaxMind의 무료버전 데이터를 사용) 을 래핑한 서비스.

ipV4 또는 ipV6 주소를 보내면 IP주소의 위치정보를 JSON 형태로 리턴

## Comments



### Comment 808

- Author: xguru
- Created: 2019-12-30T16:02:50+09:00
- Points: 1

geoip-lite 모듈은 속도를 위해 모든 데이터를 램에 올리는 형태로 동작해서

AWS의 micro 인스턴스에서는 동작이 불가능합니다.

위 코드를 가져다가 직접 호스팅할거 아니면 여기 주소에 있는

https://geo.risk3sixty.com/

또는

https://freegeoip.app/

등을 이용해도 됩니다.

### Comment 809

- Author: xguru
- Created: 2019-12-30T16:03:22+09:00
- Points: 1
- Parent comment: 808
- Depth: 1

그리고 위 코드는 x-forwarded-for 처리 로직을 빼고는 그리 복잡한게 아니어서,

NodeJS 서버를 특별히 따로 실행하는게 불편하다면

MaxMind 가 공개하는 https://dev.maxmind.com/geoip/geoip2/geolite2/ 의 geolite2 DB를

가져다가 직접 사용하는게 편할수도 있습니다.
