Skip to content

Express app utilising Maxmind GeoLite2 database with weekly auto updation of database file and a docker file to create image

License

Notifications You must be signed in to change notification settings

mib200/express-geoiplite2-maxmind

Repository files navigation

Maxmind GeoipLite 2 Database API App and Docker container

Express app utilising Maxmind GeoLite2 database. The app updates the database file at 00:00 hrs on every Sunday.

How to run?

$ npm install
$ node index.js

How to resolve an IP address [API Endpoint]?

Send a query param of ?ip=A.B.C.D at the end of the hosted URL http://localhost:3000/?ip=A.B.C.D

What is the response that we get?

{
    "ip": "A.B.C.D",
    "continent": "Asia",
    "country_code": "IN",
    "country_name": "India",
    "time_zone": "Asia/Kolkata",
    "latitude": 17.3753,
    "longitude": 78.4744,
    "accuracy_radius": 10,
    "city": "Hyderabad",
    "region_name": "Telangana"
}

Is there a docker image for this?

You bet! You can use the image by executing (parameters of -p 3000:3000 will enable you to access the API from the URL http://localhost:3000/?ip=A.B.C.D). Read more at official Docker Repository

$ docker container run -d --name geoip-server -p 3000:3000 mib200/geoiplite2-maxmind

Features

  • Downloads the latest DB file automatically from Maxmind website.
  • Auto updates the database file every week.
  • Returns an absolute clean JSON response depending on how many fields are found in Maxmind DB response.

References

License

MIT

About

Express app utilising Maxmind GeoLite2 database with weekly auto updation of database file and a docker file to create image

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published