Skip to content

WildDev/geo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

Service that allows to detect a user location based on it's ip. Currently, is only integrated with ipstack

Java CI with Maven Docker Image CI

How it works

  1. Configure proxy to set X-Real-IP header
  2. Route traffic to the service
  3. Send a request

Example:

curl "https://test.website/location" -H "X-Real-IP: 127.0.0.1" -v

< HTTP/1.1 200
< Content-Type: application/json
<
{
    "country": {
        "code": "DE",
        "name": "Germany"
    },
    "city": "Dusseldorf"
}

Get started

Build requirements:

  • latest JDK and Maven

Runtime stack:

  • Java 20+
  • API credentials for ipstack

Checkout the project and build it using mvn package command

An example run:

java -jar -Xmx256M target/geo.jar \
    --server.port=8000 \
    --spring.cors.allowed-origins=https://test.website \
    --integration.ipstack.url=https://api.ipstack.com \
    --integration.ipstack.access-key=723953e7b0e27c762c38213b7c71fd77

Also available on Docker Hub

About

Restful geolocation detector

Resources

License

Stars

Watchers

Forks

Packages

No packages published