- Notifications
You must be signed in to change notification settings - Fork26
A JSON REST api for the db-ip.com geoip database
License
thomasdarimont/geoip-dbip-rest-api
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
This project leverages a simple Java webapp that acts as a wrapper around thedb-ip.com geoip databases.The database is available at different levels of details (depends on how much you spend). The basic databases are availablefor free. Compared to other geoip services we considered thedb-ip.com geoip databases very accurateand complete.
Drop the war into you favorite servlet container (like Tomcat). The REST interfaceis straightforward, just put the ip to query data for in the path:
$ curl -i http://localhost:8080/dbip-api/80.85.196.23HTTP/1.1 200 OKServer: Apache-Coyote/1.1Content-Type: application/json;charset=UTF-8{ "address":"80.85.196.23", "country":"DE", "stateprov":"Hamburg", "city":"Hamburg", "latitude":"53.5986", "longitude":"10.0707", "isp":"OTTO GmbH & Co. KG", "organization":"Otto Versand Hamburg GmbH", "timezone":"Europe/Berlin", "cityDistrict":"Wandsbek", "timezoneOffset":"2" }To configure the location of the db-ip database, pass along the javasystem property-Ddbip-path= or configure the JNDI environmentkeydbip-path.
The response above is a response rendered with the full dp-ip database. Usecurl -i http://localhost:8080/dbip-api/ping as availability monitoring endpoint.
The project offers ØMQ bindings as well. By default, ØMQ binds totcp://*:19000.You can configure the binding by passing the java system property-Dzmq-bindingor configuring the JNDI environment keyzmq-binding.
This should install the current version into your local repository
$ mvn clean verifyDefine new versions
$ export NEXT_VERSION=<version>$ export NEXT_DEVELOPMENT_VERSION=<version>-SNAPSHOTThen execute the release chain
$ mvn org.codehaus.mojo:versions-maven-plugin:2.0:set -DgenerateBackupPoms=false -DnewVersion=$NEXT_VERSION$ git commit -a -m "pushes to release version $NEXT_VERSION"$ mvn -P releaseThen, increment to next development version:
$ git tag -a v$NEXT_VERSION -m "`curl -s http://whatthecommit.com/index.txt`"$ mvn org.codehaus.mojo:versions-maven-plugin:2.0:set -DgenerateBackupPoms=false -DnewVersion=$NEXT_DEVELOPMENT_VERSION$ git commit -a -m "pushes to development version $NEXT_DEVELOPMENT_VERSION"$ git push origin tag v$NEXT_VERSION && git push originWe're looking forward to your comments, issues and pull requests!
This project is licensed under theApache License, Version 2.
About
A JSON REST api for the db-ip.com geoip database
Resources
License
Uh oh!
There was an error while loading.Please reload this page.