Giter VIP home page Giter VIP logo

geode's Introduction

About

Geode is a simple Web frontend for MaxMind's GeoIP2 City database.

Setup

Purchase a GeoIP2 City database, or grab a free GeoLite2 City database from MaxMind:

$ curl -s "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=<LICENSE_KEY>&suffix=tar.gz" | \
  tar -xz

Build, test, and run

Use Nix to build and test:

$ nix-build

Then run the compiled binary:

$ GEOIP_DB=GeoLite2-City.mmdb PORT=3000 ./result/bin/geode
Running geode...
Setting phasers to stun... (port 3000) (ctrl-c to quit)

Usage

Try it out:

$ curl localhost:3000/34.213.34.148
{
    "city": "Boardman",
    "continent": "North America",
    "continentCode": "NA",
    "countryCode": "US",
    "countryName": "United States",
    "latitude": 45.8491,
    "longitude": -119.7143,
    "postalCode": "97818",
    "region": "OR",
    "regionName": "Oregon"
}

If you make a request to / (leaving off any IP address) Geode will look up your IP address by checking for any X-Forwarded-For header then falling back to the socket address of your client.

geode's People

Contributors

earldouglas avatar ods94065 avatar

Watchers

 avatar

geode's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.